]> Pileus Git - ~andy/fetchmail/commitdiff
Fix groupnames bug.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 4 Oct 1997 01:23:05 +0000 (01:23 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 4 Oct 1997 01:23:05 +0000 (01:23 -0000)
svn path=/trunk/; revision=1472

NEWS
rfc822.c

diff --git a/NEWS b/NEWS
index 9f0eeafd373d717d9f58cf6ff5ff7d4d79671f72..1ca457241d34d24f8f070aae26180d48d66310d1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,8 @@ fetchmail-4.3.0 ()
 * Added code to have %F in an MDA string expand to the From address
 * Added code to prevent buffer spamming via the MDA %T/%s escape.
 * Luca Olivetti's --qvirtual option patch for qmail users.  
+* Fixed a bug in the code that was supposed to suppress expansion of RFC822 
+  groupnames.  (Thanks to Santiago Vila Doncel for pointing this.)
 
 There are 286 people on the fetchmail-friends list.
 
index 14187bde625f8584243da62e86de447473e2cd42..a41e14a38e59e6d95c73570a60edcabd234f65e4 100644 (file)
--- a/rfc822.c
+++ b/rfc822.c
@@ -25,7 +25,7 @@ char *reply_hack(buf, host)
 char *buf;             /* header to be hacked */
 const char *host;      /* server hostname */
 {
-    char *from, *cp;
+    char *from, *cp, last_nws = '\0';
     int parendepth, state, has_bare_name_part, has_host_part;
     int addresscount = 1;
 
@@ -72,6 +72,8 @@ const char *host;     /* server hostname */
                break;
 
            case 1:     /* we've seen the colon, we're looking for addresses */
+               if (!isspace(*from))
+                   last_nws = *from;
                if (*from == '<')
                    state = 3;
                else if (*from == '@')
@@ -79,14 +81,14 @@ const char *host;   /* server hostname */
                else if (*from == '"')
                    state = 2;
                /*
-                * Not expanding on from[-1] == ';' deals with groupnames,
+                * Not expanding on last non-WS == ';' deals with groupnames,
                 * an obscure misfeature described in sections
                 * 6.1, 6.2.6, and A.1.5 of the RFC822 standard.
                 */
                else if ((*from == ',' || HEADER_END(from) || from[1] == '(')
                         && has_bare_name_part
                         && !has_host_part
-                        && from[-1] != ';')
+                        && last_nws != ';')
                {
                    int hostlen;