aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1999-09-14 06:35:11 +0000
committerEric S. Raymond <esr@thyrsus.com>1999-09-14 06:35:11 +0000
commit582eb25eccedcdbff029947f777a111a9b7008af (patch)
tree8fb2a0a2d68e5df5b21ea166c65bed950f1f8bce /driver.c
parent8f826df8fbadd811f6bcc31344e3d8472bd6f2bb (diff)
downloadfetchmail-582eb25eccedcdbff029947f777a111a9b7008af.tar.gz
fetchmail-582eb25eccedcdbff029947f777a111a9b7008af.tar.bz2
fetchmail-582eb25eccedcdbff029947f777a111a9b7008af.zip
Duplicate suppression.
svn path=/trunk/; revision=2553
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/driver.c b/driver.c
index 444eda0e..42bfacfc 100644
--- a/driver.c
+++ b/driver.c
@@ -528,6 +528,29 @@ static int readheaders(int sock,
has_nuls = (linelen != strlen(line));
/*
+ * When mail delivered to a multidrop mailbox on the server is
+ * addressed to multiple people, there will be one copy left
+ * in the box for each recipient. Thus, if the mail is addressed
+ * to N people, each recipient would get N copies.
+ *
+ * Foil this by suppressing all but one copy of a message with
+ * a given Message-ID. Note: This implementation only catches
+ * runs of successive identical messages, but that should be
+ * good enough.
+ */
+ if (MULTIDROP(ctl) && !strncasecmp(line, "Message-ID:", 11))
+ {
+ if (ctl->lastid && !strcasecmp(ctl->lastid, line))
+ return(PS_REFUSED);
+ else
+ {
+ if (ctl->lastid)
+ free(ctl->lastid);
+ ctl->lastid = strdup(line);
+ }
+ }
+
+ /*
* The University of Washington IMAP server (the reference
* implementation of IMAP4 written by Mark Crispin) relies
* on being able to keep base-UID information in a special