]> Pileus Git - ~andy/fetchmail/commitdiff
Address Mark BBurton's problem.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 3 Oct 1999 12:36:26 +0000 (12:36 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 3 Oct 1999 12:36:26 +0000 (12:36 -0000)
svn path=/trunk/; revision=2633

NEWS
driver.c

diff --git a/NEWS b/NEWS
index 005b12d9aa33d062dd3666889de1db8a9c6dcd65..0f09d8998406c2388de3bdaadf3f4ed631c7d485 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@
 * Joe Loughry <loughry@uswest.net> sent a patch to handle multihomed machines.
 * Changed mimedecode default to `off'; it seems that doing RFC2047 decoding
   on headers throws away information that the MUA may need to see.
+* Change Received header parsing to no longer demand an embedded dot in
+  a mailhost address.
 
 fetchmail-5.1.1 (Wed Sep 29 11:52:06 EDT 1999), 17827 lines:
 * Added workaround, fetchmailconf warning, and FAQ about Novell GroupWise.
index 4d2a37db0760cb95ce4a3e7386610cae31221c4e..950830f0c65d2e7e47d05707af7f80a4f2b98c1f 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -230,6 +230,19 @@ static void find_server_names(const char *hdr,
     }
 }
 
+/*
+ * Return zero on a syntactically invalid address, nz on a valid one.
+ *
+ * This used to be strchr(a, '.'), but it turns out that lines like this
+ *
+ * Received: from punt-1.mail.demon.net by mailstore for markb@ordern.com
+ *          id 938765929:10:27223:2; Fri, 01 Oct 99 08:18:49 GMT
+ *
+ * are not uncommon.  So now we just check that the following token is
+ * not itself an email address.
+ */
+#define VALID_ADDRESS(a)       !strchr(rbuf, '@')
+
 static char *parse_received(struct query *ctl, char *bufp)
 /* try to extract real address from the Received line */
 /* If a valid Received: line is found, we return the full address in
@@ -254,7 +267,7 @@ static char *parse_received(struct query *ctl, char *bufp)
     if (outlevel >= O_DEBUG)
        report(stdout, _("analyzing Received line:\n%s"), bufp);
 
-    /* search for whitepace-surrounded "by" followed by xxxx.yyyy */
+    /* search for whitepace-surrounded "by" followed by valid address */
     for (base = bufp;  ; base = ok + 2)
     {
        if (!(ok = strstr(base, "by")))
@@ -273,8 +286,8 @@ static char *parse_received(struct query *ctl, char *bufp)
                *tp++ = *sp;
            *tp = '\0';
 
-           /* look for embedded periods */
-           if (strchr(rbuf, '.'))
+           /* look for valid address */
+           if (VALID_ADDRESS(rbuf))
                break;
            else
                ok = sp - 1;    /* arrange to skip this token */