aboutsummaryrefslogtreecommitdiffstats
path: root/transact.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2003-07-17 00:55:18 +0000
committerEric S. Raymond <esr@thyrsus.com>2003-07-17 00:55:18 +0000
commit8a6226720dbb281ad0b409b06e182621cc08b241 (patch)
treec949205e554a713a1b87d130e0cc34807614b9e3 /transact.c
parent8c73d06cb2761c6d4082d00188a82007b22c8095 (diff)
downloadfetchmail-8a6226720dbb281ad0b409b06e182621cc08b241.tar.gz
fetchmail-8a6226720dbb281ad0b409b06e182621cc08b241.tar.bz2
fetchmail-8a6226720dbb281ad0b409b06e182621cc08b241.zip
First round ofmlong-delayed bug fixes.
svn path=/trunk/; revision=3814
Diffstat (limited to 'transact.c')
-rw-r--r--transact.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/transact.c b/transact.c
index 6674a3ff..fb8fb043 100644
--- a/transact.c
+++ b/transact.c
@@ -381,6 +381,7 @@ int readheaders(int sock,
flag headers_ok, has_nuls;
int olderrs, good_addresses, bad_addresses;
int retain_mail = 0;
+ flag already_has_return_path = FALSE;
sizeticker = 0;
has_nuls = headers_ok = FALSE;
@@ -676,9 +677,15 @@ int readheaders(int sock,
* not trigger bounces if delivery fails. What we *do* need to do is
* make sure we never try to rewrite such a blank Return-Path. We
* handle this with a check for <> in the rewrite logic above.
+ *
+ * Also, if an email has multiple Return-Path: statement, we only
+ * read the first occurance, as some spam email has more than one
+ * Return-Path.
+ *
*/
- if (!strncasecmp("Return-Path:", line, 12) && (cp = nxtaddr(line)))
+ if ((already_has_return_path==FALSE) && !strncasecmp("Return-Path:", line, 12) && (cp = nxtaddr(line)))
{
+ already_has_return_path = TRUE;
strncpy(msgblk.return_path, cp, sizeof(msgblk.return_path));
msgblk.return_path[sizeof(msgblk.return_path)-1] = '\0';
if (!ctl->mda) {