aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-05-12 07:18:55 +0000
committerEric S. Raymond <esr@thyrsus.com>2001-05-12 07:18:55 +0000
commitb110bb01bf37e83549ca2103f11c1a618387713c (patch)
treefbb0aad21a9358d88a3d266ac834b5e8a7d8785c /driver.c
parentf08d646e1057978fbb2c5867c807b220cc614f65 (diff)
downloadfetchmail-b110bb01bf37e83549ca2103f11c1a618387713c.tar.gz
fetchmail-b110bb01bf37e83549ca2103f11c1a618387713c.tar.bz2
fetchmail-b110bb01bf37e83549ca2103f11c1a618387713c.zip
Fix the Sender problem.
svn path=/trunk/; revision=3307
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/driver.c b/driver.c
index 4038b484..11338f77 100644
--- a/driver.c
+++ b/driver.c
@@ -760,9 +760,27 @@ static int readheaders(int sock,
resent_from_offs = (line - msgblk.headers);
else if (!strncasecmp("Apparently-From:", line, 16))
app_from_offs = (line - msgblk.headers);
- else if (!strncasecmp("Sender:", line, 7))
+ /*
+ * Netscape 4.7 puts "Sender: zap" in mail headers. Perverse...
+ *
+ * But a literal reading of RFC822 sec. 4.4.2 supports the idea
+ * that Sender: *doesn't* have to be a working email address.
+ *
+ * The definition of the Sender header in RFC822 says, in
+ * part, "The Sender mailbox specification includes a word
+ * sequence which must correspond to a specific agent (i.e., a
+ * human user or a computer program) rather than a standard
+ * address." That implies that the contents of the Sender
+ * field don't need to be a legal email address at all So
+ * ignore any Sender or Resent-Semnder lines unless they
+ * contain @.
+ *
+ * (RFC2822 says the condents of Sender must be a valid mailbox
+ * address, which is also what RFC822 4.4.4 implies.)
+ */
+ else if (!strncasecmp("Sender:", line, 7) && strchr(line, '@'))
sender_offs = (line - msgblk.headers);
- else if (!strncasecmp("Resent-Sender:", line, 14))
+ else if (!strncasecmp("Resent-Sender:", line, 14) && strchr(line, '@'))
resent_sender_offs = (line - msgblk.headers);
#ifdef __UNUSED__