[Dovecot] "Angle" address with empty "display name"

Chris Wakelin c.d.wakelin at reading.ac.uk
Mon Jun 20 12:57:38 EEST 2005


Some clients are sending from addresses like <someone at somewhere.org>
i.e. without a "friendly" name. It seems to me from RFC2822 that you 
should either have "Display Name <someone at somewhere.org>" or just 
"someone at somewhere.org" (both without the quotes).

Dovecot, not unreasonably, treats "<someone at somewhere.org>" as having an 
empty Display Name, but this seems to confuse at least one client - our 
webmail ;) - which then displays "?" for the "from" address.

The patch below tries to make dovecot treat empty display name as 
non-existent display name (so that the IMAP "ENVELOPE" command responds 
with "NIL" instead of "" in the relevant places).

Best Wishes,
Chris

--- dovecot-1.0-stable/src/lib-mail/message-address.c.orig      Fri Apr 
  8 12:30:34 2005
+++ dovecot-1.0-stable/src/lib-mail/message-address.c   Mon Jun 20 
10:42:23 2005
@@ -140,6 +140,10 @@
                 return -1;

         ctx->addr.name = p_strdup(ctx->pool, str_c(ctx->str));
+       if (*ctx->addr.name == '\0') {
+               /* Cope with "<address>" without display name */
+               ctx->addr.name = NULL;
+       }
         if (parse_angle_addr(ctx) < 0) {
                 /* broken */
                 ctx->addr.domain = p_strdup(ctx->pool, "SYNTAX_ERROR");

-- 
--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
Christopher Wakelin,                           c.d.wakelin at reading.ac.uk
IT Services Centre, The University of Reading,  Tel: +44 (0)118 378 8439
Whiteknights, Reading, RG6 2AF, UK              Fax: +44 (0)118 975 3094



More information about the dovecot mailing list