diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2000-07-23 13:21:24 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2000-07-23 13:21:24 +0000 |
commit | 6f8f6a2834de1b996a7c958b5055d0451fdece03 (patch) | |
tree | 3489ed505b31693e68f79b143207ea2bbb4bf241 | |
parent | 4d5ea12cb31631543e3c53730e497fb63baa25ca (diff) | |
download | fetchmail-6f8f6a2834de1b996a7c958b5055d0451fdece03.tar.gz fetchmail-6f8f6a2834de1b996a7c958b5055d0451fdece03.tar.bz2 fetchmail-6f8f6a2834de1b996a7c958b5055d0451fdece03.zip |
Added dropdelivered.
svn path=/trunk/; revision=2931
-rw-r--r-- | NEWS | 10 | ||||
-rw-r--r-- | conf.c | 1 | ||||
-rw-r--r-- | driver.c | 13 | ||||
-rw-r--r-- | fetchmail-features.html | 11 | ||||
-rw-r--r-- | fetchmail.c | 5 | ||||
-rw-r--r-- | fetchmail.h | 1 | ||||
-rw-r--r-- | fetchmail.man | 17 | ||||
-rwxr-xr-x | fetchmailconf | 7 | ||||
-rw-r--r-- | rcfile_l.l | 2 | ||||
-rw-r--r-- | rcfile_y.y | 5 |
10 files changed, 67 insertions, 5 deletions
@@ -4,6 +4,16 @@ * Guenther H. Leber's fix to show expunge parameters for POP3 in fetchmail -V. * Richard Gooch's fixes to use sigation(2) in sink.c and daemon.c +* Petr Kristof's fix for sslcert configuration in fetchmailconf. +* Jiri Pavolvsky's updated cs.po. +* Cyrille Lefevre <clefevre@citeweb.net>'s patch for IPV6, + resolving FreeBSD Problem Report ports/19996. +* Added John Summerfield's pop2test to contrib. +* In the fetchmail RPM spec, stop compressing the man pages. Turns out + rpm-4.0 does a find(1) over the stuff to be installed and gzip(1)s the + manpages it finds. This gets messed up by the explicit symlink among + manpages in the spec file, which rpm redoes and gets all wrong. +* Added Antoine Beaupre's dropdelivered option. fetchmail-5.4.3 (Sun Jul 2 14:24:28 EDT 2000), 19080 lines: @@ -328,6 +328,7 @@ void dump_config(struct runctl *runp, struct query *querylist) booldump("forcecr", ctl->forcecr); booldump("pass8bits", ctl->pass8bits); booldump("dropstatus", ctl->dropstatus); + booldump("dropdelivered", ctl->dropdelivered); booldump("mimedecode", ctl->mimedecode); booldump("idle", ctl->idle); @@ -626,6 +626,19 @@ static int readheaders(int sock, } /* + * We remove all Delivered-To: headers. + * + * This is to avoid false mail loops messages when delivering + * local messages to and from a Postfix/qmail mailserver. + * + * Should be controlled by an option + */ + if (ctl->dropdelivered && !strncasecmp(line, "Delivered-To:", 13)) { + free(line); + continue; + } + + /* * If we see a Status line, it may have been inserted by an MUA * on the mail host, or it may have been inserted by the server * program after the headers in the transaction stream. This diff --git a/fetchmail-features.html b/fetchmail-features.html index 983a55a0..563596d7 100644 --- a/fetchmail-features.html +++ b/fetchmail-features.html @@ -10,7 +10,7 @@ <table width="100%" cellpadding=0><tr> <td width="30%">Back to <a href="index.html">Fetchmail Home Page</a> <td width="30%" align=center>To <a href="/~esr/sitemap.html">Site Map</a> -<td width="30%" align=right>$Date: 2000/06/07 02:21:34 $ +<td width="30%" align=right>$Date: 2000/07/23 13:21:22 $ </table> <HR> @@ -19,6 +19,13 @@ <H2>Since 5.0:</H2> <UL> <LI> +Added a dropdelivered option to discard Delivered-To headers. This +addresses a problem with using fetchmail and postfix as a relay inside +a domain; when postfix sees incoming messages with delivered-to +headers looking exactly the same as the ones it adds himself, it +bounces the message. + +<LI> Added --smtpname to set username and domain portion of SMTP "RCPT TO" command. >fetchmail@mail.julianhaight.com>. @@ -221,7 +228,7 @@ get-mail, gwpop, pimp-1.0, pop-perl5-1.2, popc, popmail-1.6 and upop.<P> <table width="100%" cellpadding=0><tr> <td width="30%">Back to <a href="index.html">Fetchmail Home Page</a> <td width="30%" align=center>To <a href="/~esr/sitemap.html">Site Map</a> -<td width="30%" align=right>$Date: 2000/06/07 02:21:34 $ +<td width="30%" align=right>$Date: 2000/07/23 13:21:22 $ </table> <P><ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS> diff --git a/fetchmail.c b/fetchmail.c index 33041b9d..2b5f6ae6 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -847,6 +847,7 @@ static void optmerge(struct query *h2, struct query *h1, int force) FLAG_MERGE(stripcr); FLAG_MERGE(pass8bits); FLAG_MERGE(dropstatus); + FLAG_MERGE(dropdelivered); FLAG_MERGE(mimedecode); FLAG_MERGE(idle); FLAG_MERGE(limit); @@ -1014,6 +1015,7 @@ static int load_params(int argc, char **argv, int optind) DEFAULT(ctl->forcecr, FALSE); DEFAULT(ctl->pass8bits, FALSE); DEFAULT(ctl->dropstatus, FALSE); + DEFAULT(ctl->dropdelivered, FALSE); DEFAULT(ctl->mimedecode, FALSE); DEFAULT(ctl->idle, FALSE); DEFAULT(ctl->server.dns, TRUE); @@ -1590,6 +1592,9 @@ static void dump_params (struct runctl *runp, printf(_(" Nonempty Status lines will be %s (dropstatus %s)\n"), ctl->dropstatus ? _("discarded") : _("kept"), ctl->dropstatus ? "on" : "off"); + printf(_(" Delivered-To lines will be %s (dropdelivered %s)\n"), + ctl->dropdelivered ? _("discarded") : _("kept"), + ctl->dropdelivered ? "on" : "off"); if (NUM_NONZERO(ctl->limit)) { if (NUM_NONZERO(ctl->limit)) diff --git a/fetchmail.h b/fetchmail.h index 980bd47b..c6fc2ebd 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -261,6 +261,7 @@ struct query flag forcecr; /* if TRUE, force CRs before LFs in text */ flag pass8bits; /* if TRUE, ignore Content-Transfer-Encoding */ flag dropstatus; /* if TRUE, drop Status lines in mail */ + flag dropdelivered; /* if TRUE, drop Delivered-To lines in mail */ flag mimedecode; /* if TRUE, decode MIME-armored messages */ flag idle; /* if TRUE, idle after each poll */ int limit; /* limit size of retrieved messages */ diff --git a/fetchmail.man b/fetchmail.man index bc988e8e..c800276b 100644 --- a/fetchmail.man +++ b/fetchmail.man @@ -1256,6 +1256,9 @@ T} dropstatus \& T{ Strip Status and X-Mozilla-Status lines out of incoming mail T} +dropdelivered \& T{ +Strip Delivered-To lines out of incoming mail +T} mimedecode \& T{ Convert quoted-printable to 8-bit in MIME messages T} @@ -1286,6 +1289,9 @@ T} no dropstatus \& T{ Don't drop Status headers (default) T} +no dropdelivered \& T{ +Don't drop Delivered-To headers (default) +T} no mimedecode \& T{ Don't convert quoted-printable to 8-bit in MIME messages (default) T} @@ -1330,8 +1336,9 @@ All options correspond to the obvious command-line arguments, except the following: `via', `interval', `aka', `is', `to', `dns'/`no dns', `checkalias'/`no checkalias', `password', `preconnect', `postconnect', `localdomains', `stripcr'/`no stripcr', `forcecr'/`no forcecr', -`pass8bits'/`no pass8bits' `dropstatus/no dropstatus', `mimedecode/no -mimedecode', `idle/no idle', and `no envelope'. +`pass8bits'/`no pass8bits' `dropstatus/no dropstatus', +`dropdelivered/no dropdelivered', `mimedecode/no mimedecode', `idle/no +idle', and `no envelope'. .PP The `via' option is for use with ssh, or if you want to have more than one configuration pointing at the same site. If it is present, @@ -1480,6 +1487,12 @@ confuse some new-mail notifiers, which assume that anything with a Status line in it has been seen. (Note: the empty Status lines inserted by some buggy POP servers are unconditionally discarded.) .PP +The `dropdelivered' option controls wether Delivered-To headers will +be kept in fetched mail (the default) or discarded. These headers are +added by Qmail and Postfix mailservers in order to avoid mail loops but +may get in your way if you try to "mirror" a mailserver within the same +domain. Use with caution. +.PP The `mimedecode' option controls whether MIME messages using the quoted-printable encoding are automatically converted into pure 8-bit data. If you are delivering mail to an ESMTP-capable, 8-bit-clean diff --git a/fetchmailconf b/fetchmailconf index 11a7a559..d7bb07b9 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -216,6 +216,7 @@ class User: self.pass8bits = FALSE # Force BODY=7BIT self.mimedecode = FALSE # Undo MIME armoring self.dropstatus = FALSE # Drop incoming Status lines + self.dropdelivered = FALSE # Drop incoming Delivered-To lines self.idle = FALSE # IDLE after poll self.limit = 0 # Message size limit self.warnings = 0 # Size warning interval @@ -247,6 +248,7 @@ class User: ('pass8bits', 'Boolean'), ('mimedecode', 'Boolean'), ('dropstatus', 'Boolean'), + ('dropdelivered', 'Boolean') ('idle', 'Boolean'), ('limit', 'Int'), ('warnings', 'Int'), @@ -277,6 +279,7 @@ class User: or self.pass8bits != UserDefaults.pass8bits or self.mimedecode != UserDefaults.mimedecode or self.dropstatus != UserDefaults.dropstatus + or self.dropdelivered != UserDefaults.dropdelivered or self.idle != UserDefaults.idle): res = res + " options" if self.keep != UserDefaults.keep: @@ -297,6 +300,8 @@ class User: res = res + flag2str(self.mimedecode, 'mimedecode') if self.dropstatus != UserDefaults.dropstatus: res = res + flag2str(self.dropstatus, 'dropstatus') + if self.dropdelivered != UserDefaults.dropdelivered: + res = res + flag2str(self.dropdelivered, 'dropdelivered') if self.idle != UserDefaults.idle: res = res + flag2str(self.idle, 'idle') if self.limit != UserDefaults.limit: @@ -1509,6 +1514,8 @@ class UserEdit(Frame, MyWidget): variable=self.mimedecode).pack(side=TOP, anchor=W) Checkbutton(optwin, text="Drop Status lines from forwarded messages", variable=self.dropstatus).pack(side=TOP, anchor=W) + Checkbutton(optwin, text="Drop Delivered-To lines from forwarded messages", + variable=self.dropdelivered).pack(side=TOP, anchor=W) optwin.pack(fill=X) if mode != 'novice': @@ -130,6 +130,7 @@ noforcecr | nostripcr | nopass8(bits)? | nodropstatus | +nodropdelivered | nomimedec(ode)? | noidle { yyless(2); @@ -146,6 +147,7 @@ forcecr { return FORCECR; } stripcr { return STRIPCR; } pass8(bits)? { return PASS8BITS; } dropstatus { return DROPSTATUS; } +dropdelivered { return DROPDELIVERED; } mimedec(ode)? { return MIMEDECODE; } idle { return IDLE; } dns { return DNS; } @@ -68,7 +68,8 @@ extern char * yytext; %token <proto> PROTO %token <sval> STRING %token <number> NUMBER -%token NO KEEP FLUSH FETCHALL REWRITE FORCECR STRIPCR PASS8BITS DROPSTATUS +%token NO KEEP FLUSH FETCHALL REWRITE FORCECR STRIPCR PASS8BITS +%token DROPSTATUS DROPDELIVERED %token DNS SERVICE PORT UIDL INTERVAL MIMEDECODE IDLE CHECKALIAS %token SSL SSLKEY SSLCERT @@ -322,6 +323,7 @@ user_option : TO localnames HERE | STRIPCR {current.stripcr = FLAG_TRUE;} | PASS8BITS {current.pass8bits = FLAG_TRUE;} | DROPSTATUS {current.dropstatus = FLAG_TRUE;} + | DROPDELIVERED {current.dropdelivered = FLAG_TRUE;} | MIMEDECODE {current.mimedecode = FLAG_TRUE;} | IDLE {current.idle = FLAG_TRUE;} @@ -337,6 +339,7 @@ user_option : TO localnames HERE | NO STRIPCR {current.stripcr = FLAG_FALSE;} | NO PASS8BITS {current.pass8bits = FLAG_FALSE;} | NO DROPSTATUS {current.dropstatus = FLAG_FALSE;} + | NO DROPDELIVERED {current.dropdelivered = FLAG_FALSE;} | NO MIMEDECODE {current.mimedecode = FLAG_FALSE;} | NO IDLE {current.idle = FLAG_FALSE;} |