]> Pileus Git - ~andy/fetchmail/commitdiff
Added dropdelivered.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 23 Jul 2000 13:21:24 +0000 (13:21 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 23 Jul 2000 13:21:24 +0000 (13:21 -0000)
svn path=/trunk/; revision=2931

NEWS
conf.c
driver.c
fetchmail-features.html
fetchmail.c
fetchmail.h
fetchmail.man
fetchmailconf
rcfile_l.l
rcfile_y.y

diff --git a/NEWS b/NEWS
index e9f6659c9e948a14efc1d741cc53964b616d4cec..6c432729d28c189caa0a3493027aa6aa4e8b7c6b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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:
 
diff --git a/conf.c b/conf.c
index acb68f65332ac6da29ecc35f7c0770c1b543d2c7..7ac6fb66c21cde94e9105859e107c735b083fc21 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -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);
 
index 14ab16028569abaaf9ce8d4fd04dc7cc8cfbcd70..f8e02ec68bf68280a1e39f208a323bafbdc858e4 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -625,6 +625,19 @@ static int readheaders(int sock,
            continue;
        }
 
+       /*
+        * 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
index 983a55a0540b43566f96534939d4474795fdfeff..563596d741d7966d4736409ea78d6bb0c58f2dd3 100644 (file)
@@ -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>
 
 
 <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. &gt;fetchmail@mail.julianhaight.com&gt;.
@@ -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">&lt;esr@snark.thyrsus.com&gt;</A></ADDRESS>
index 33041b9d441fcc83def88d3facc6db4bf1b689c4..2b5f6ae6bd7031810dd8c457158680f43e375a77 100644 (file)
@@ -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))
index 980bd47bb922a58cc51c64f8048aeac8d852624b..c6fc2ebd25abc3446181a0ee9dd5c7da8b9929d6 100644 (file)
@@ -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 */
index bc988e8edf24586fb9b8945bf588edaadc552c7d..c800276b7036ccc33a26de2c09706edf3eca38be 100644 (file)
@@ -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
index 11a7a559effc0b566e12bd422c231cbf651b86a0..d7bb07b91e90b946e859d07212e46785178b74d1 100755 (executable)
@@ -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':
index 559bd152d2d88e8c6c5b390fd2ac9dd27c485f9d..c329fa4d42059535bd088dc0f03b466133b98b6b 100644 (file)
@@ -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; }
index 93d1c86ef672cbe6e470df22e1ea9662d11ba5bb..3a42c4e55140ba387f85da6e49f2856d7cb4ff5c 100644 (file)
@@ -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;}