From 582eb25eccedcdbff029947f777a111a9b7008af Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 14 Sep 1999 06:35:11 +0000 Subject: Duplicate suppression. svn path=/trunk/; revision=2553 --- driver.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'driver.c') diff --git a/driver.c b/driver.c index 444eda0e..42bfacfc 100644 --- a/driver.c +++ b/driver.c @@ -527,6 +527,29 @@ static int readheaders(int sock, /* we see an ordinary (non-header, non-message-delimiter line */ 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 -- cgit v1.2.3