]> Pileus Git - ~andy/fetchmail/commitdiff
Drop LAST support, force UIDL.
authorMatthias Andree <matthias.andree@gmx.de>
Tue, 14 Dec 2010 19:54:45 +0000 (20:54 +0100)
committerMatthias Andree <matthias.andree@gmx.de>
Tue, 14 Dec 2010 19:58:38 +0000 (20:58 +0100)
NEWS
conf.c
fetchmail.c
fetchmail.h
fetchmail.man
fetchmailconf.py
options.c
pop3.c
rcfile_y.y
uid.c

diff --git a/NEWS b/NEWS
index 383c5e70b3ec9bf79381fa0ac7adc89468104ca6..367e9079b5d24c90e43a1cda8db9b22884afe244 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -51,6 +51,8 @@ NOTE THIS IS AN ALPHA RELEASE THAT HAS NOT BEEN THOROUGHLY TESTED!
   mail kept on a POP3 server. Where the 6.3.X code was of O(n^2) complexity,
   we're down to O(n log n).
   Contributed by Rainer Weikusat, MAD Partners Ltd./MSS GmbH.
+* The POP3 code now always uses UIDL, except if "fetchall" is in effect.
+  Fixes BerliOS Bug #16172.
 
 # FEATURES ADDED
 * Fetchmail can now retrieve credentials from PWMD. This needs to be enabled at
@@ -62,15 +64,19 @@ NOTE THIS IS AN ALPHA RELEASE THAT HAS NOT BEEN THOROUGHLY TESTED!
   fail to be retrieved due to server errors.  Both the continue and markseen
   options will skip the message with errors and allow the session to
   continue so that subsequent messages can be retrieved.  The markseen
-  option will also mark the message with errors as seen.  The default policy
-  is to abort the session whenever a server error occurs.
+  option will also mark the message with errors as seen.
+  The default policy is to abort the session whenever a server error occurs.
   Contributed by Craig Brown.
 
 # REMOVED FEATURES
-* POP2 and RPOP were long obsolete and removed
-* Trio was removed
-* Support for systems that do not conform to C89 and POSIX 2001 was removed, this includes
-  BeOS, EMX, NeXTSTEP.
+* POP2 was removed
+* RPOP (not actually a protocol, but a variant of POP3) was removed
+* POP3: the uidl option has been removed. It is no longer configurable.
+* POP3: LAST is no longer used. It was removed from POP3 in 1994, and it could
+  cause mail loss.
+* Trio was removed, fetchmail expects reasonable stdio.h support levels.
+* Support for systems that do not conform to C89 and POSIX 2001 was removed,
+  this means that BeOS, EMX, NeXTSTEP quirks are no longer worked around.
 * The MX and host alias DNS lookups that fetchmail performs in multidrop mode
   have been removed. They were based on the mistaken assumption that the
   IMAP/POP3 server was also the MX server, which is rarely the case.  They have
diff --git a/conf.c b/conf.c
index c810e30df249a46eabf41d7646ab95313e2d59f7..f02dbc76897d60633cba8ff6835ac92f6bae34aa 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -282,8 +282,6 @@ void dump_config(struct runctl *runp, struct query *querylist)
 #ifdef HAVE_RES_SEARCH
            booldump("dns", ctl->server.dns);
 #endif /* HAVE_RES_SEARCH */
-           booldump("uidl", ctl->server.uidl);
-
            listdump("aka", ctl->server.akalist);
            listdump("localdomains", ctl->server.localdomains);
 
index c99468f868b0f33deb89185585c973b2fce4ebda..d2da8b62886261989c64e7cffb0857220c8e499a 100644 (file)
@@ -1226,7 +1226,6 @@ static void optmerge(struct query *h2, struct query *h1, int force)
     FLAG_MERGE(server.skip);
     FLAG_MERGE(server.dns);
     FLAG_MERGE(server.checkalias);
-    FLAG_MERGE(server.uidl);
     FLAG_MERGE(server.principal);
 
 #ifdef CAN_MONITOR
@@ -1590,7 +1589,6 @@ static int load_params(int argc, char **argv, int optind)
            DEFAULT(ctl->mimedecode, FALSE);
            DEFAULT(ctl->idle, FALSE);
            DEFAULT(ctl->server.dns, TRUE);
-           DEFAULT(ctl->server.uidl, FALSE);
            DEFAULT(ctl->use_ssl, FALSE);
            DEFAULT(ctl->sslcertck, FALSE);
            DEFAULT(ctl->server.checkalias, FALSE);
@@ -1953,8 +1951,6 @@ static void dump_params (struct runctl *runp,
            printf(GT_(" (using service %s)"), ctl->server.service);
        else if (outlevel >= O_VERBOSE)
            printf(GT_(" (using default port)"));
-       if (ctl->server.uidl && MAILBOX_PROTOCOL(ctl))
-           printf(GT_(" (forcing UIDL use)"));
        putchar('.');
        putchar('\n');
        switch (ctl->server.authenticate)
index a1048dc8bff2a35641c5e8fe1c92569475d2fc1a..a1b8f119e68702400b43dee1e0bc4542f5487263 100644 (file)
@@ -262,7 +262,6 @@ struct hostdata             /* shared among all user connections to given server */
     char *qvirtual;                    /* prefix removed from local user id */
     flag skip;                         /* suppress poll in implicit mode? */
     flag dns;                          /* do DNS lookup on multidrop? */
-    flag uidl;                         /* use RFC1725 UIDLs? */
 #ifdef SDPS_ENABLE
     flag sdps;                         /* use Demon Internet SDPS *ENV */
 #endif /* SDPS_ENABLE */
index cbe907ffa41e24edc6e4c0d70edf8ddaa30a4e3c..f56503f012b1fff938dc1380a475608a6bc4853f 100644 (file)
@@ -224,8 +224,7 @@ Keep retrieved messages on the remote mailserver.  Normally, messages
 are deleted from the folder on the mailserver after they have been retrieved.
 Specifying the \fBkeep\fP option causes retrieved messages to remain in
 your folder on the mailserver.  This option does not work with ETRN or
-ODMR. If used with POP3, it is recommended to also specify the \-\-uidl
-option or uidl keyword.
+ODMR.
 .TP
 .B \-K | \-\-nokeep
 (Keyword: nokeep)
@@ -245,8 +244,7 @@ you check your mail with other clients than fetchmail, and cause
 fetchmail to delete a message it had never fetched before.  It can also
 cause mail loss if the mail server marks the message seen after
 retrieval (IMAP2 servers). You should probably not use this option in your
-configuration file. If you use it with POP3, you must use the 'uidl'
-option. What you probably want is the default setting: if you don't
+configuration file. What you probably want is the default setting: if you don't
 specify '\-k', then fetchmail will automatically delete messages after
 successful delivery.
 .TP
@@ -295,19 +293,6 @@ ODMR mode requires an ODMR-capable server and works similarly to
 ETRN, except that it does not require the client machine to have
 a static DNS.
 .TP
-.B \-U | \-\-uidl
-(Keyword: uidl)
-.br
-Force UIDL use (effective only with POP3).  Force client-side tracking
-of 'newness' of messages (UIDL stands for "unique ID listing" and is
-described in RFC1939).  Use with 'keep' to use a mailbox as a baby
-news drop for a group of users. The fact that seen messages are skipped
-is logged, unless error logging is done through syslog while running in
-daemon mode.  Note that fetchmail may automatically enable this option
-depending on upstream server capabilities.  Note also that this option
-may be removed and forced enabled in a future fetchmail version. See
-also: \-\-idfile.
-.TP
 .B \-\-idle (since 6.3.3)
 (Keyword: idle, since before 6.0.0)
 .br
@@ -1130,14 +1115,10 @@ retrieves the full message with header and body, sets the "seen" flag
 that.
 .PP
 \fBfetchmail\fP will always use the RETR command if "fetchall" is set.
-\fBfetchmail\fP will also use the RETR command if "keep" is set and
-"uidl" is unset.  Finally, \fBfetchmail\fP will use the RETR command on
+As a workaround, \fBfetchmail\fP will use the RETR command on
 Maillennium POP3/PROXY servers (used by Comcast) to avoid a deliberate
 TOP misinterpretation in this server that causes message corruption.
 .PP
-In all other cases, \fBfetchmail\fP will use the TOP command. This
-implies that in "keep" setups, "uidl" must be set if "TOP" is desired.
-.PP
 \fBNote\fP that this description is true for the current version of
 fetchmail, but the behavior may change in future versions. In
 particular, fetchmail may prefer the RETR command because the TOP
@@ -1769,12 +1750,6 @@ T}
 no checkalias  \&      m       T{
 Do comparison by name for multidrop (default)
 T}
-uidl           \-U     \&      T{
-Force POP3 to use client-side UIDLs (recommended)
-T}
-no uidl        \&      \&      T{
-Turn off POP3 use of client-side UIDLs (default)
-T}
 interval       \&      \&      T{
 Only check this site every N poll cycles; N is a numeric argument.
 T}
@@ -1870,7 +1845,7 @@ postconnect       \&      \&      T{
 Command to be executed after each connection
 T}
 keep           \-k     \&      T{
-Don't delete seen messages from server (for POP3, uidl is recommended)
+Don't delete seen messages from server
 T}
 flush          \-F     \&      T{
 Flush all seen messages before querying (DANGEROUS)
index 36819144bb205fc639e33d654d847b88d6dcea62..9088def44881799508ed6981867ad3b38dcf2688 100755 (executable)
@@ -88,7 +88,6 @@ class Server:
        self.interval = 0               # Skip interval
        self.protocol = 'auto'          # Default to auto protocol
        self.service = None             # Service name to use
-       self.uidl = FALSE               # Don't use RFC1725 UIDLs by default
        self.auth = 'any'               # Default to password authentication
        self.timeout = 300              # 5-minute timeout
        self.envelope = 'Received'      # Envelope-address header
@@ -115,7 +114,6 @@ class Server:
            ('interval',  'Int'),
            ('protocol',  'String'),
            ('service',   'String'),
-           ('uidl',      'Boolean'),
            ('auth',      'String'),
            ('timeout',   'Int'),
            ('envelope',  'String'),
@@ -159,12 +157,10 @@ class Server:
            res = res + (" qvirtual " + str(self.qvirtual) + "\n");
        if self.auth != ServerDefaults.auth:
            res = res + " auth " + self.auth
-       if self.dns != ServerDefaults.dns or self.uidl != ServerDefaults.uidl:
+       if self.dns != ServerDefaults.dns
            res = res + " and options"
        if self.dns != ServerDefaults.dns:
            res = res + flag2str(self.dns, 'dns')
-       if self.uidl != ServerDefaults.uidl:
-           res = res + flag2str(self.uidl, 'uidl')
        if folded:      res = res + "\n    "
        else:        res = res + " "
 
@@ -1130,7 +1126,6 @@ class ServerEdit(Frame, MyWidget):
        # a custom port number you should be in expert mode and playing
        # close enough attention to notice this...
        self.service.set(defaultports[proto])
-       if not proto in ("POP3", "APOP", "KPOP"): self.uidl.state = DISABLED
 
     def user_edit(self, username, mode):
        self.subwidgets[username] = UserEdit(username, self).edit(mode, Toplevel())
@@ -1187,9 +1182,6 @@ class ServerEdit(Frame, MyWidget):
            LabeledEntry(protwin, 'On server TCP/IP service:',
                      self.service, leftwidth).pack(side=TOP, fill=X)
            self.defaultPort()
-           Checkbutton(protwin,
-               text="POP3: track `seen' with client-side UIDLs?",
-               variable=self.uidl).pack(side=TOP)
        Button(protwin, text='Probe for supported protocols', fg='blue',
               command=self.autoprobe).pack(side=LEFT)
        Button(protwin, text='Help', fg='blue',
index 356bbc91c8e1661bb0626c370958ddcf15aa9ab3..1ab753999a817b44b2db3b463400800662a0312c 100644 (file)
--- a/options.c
+++ b/options.c
@@ -341,7 +341,7 @@ int parsecmdline (int argc /** argument count */,
            }
            break;
        case 'U':
-           ctl->server.uidl = FLAG_TRUE;
+           /* EMPTY - removed in 6.4.0 */
            break;
        case LA_IDLE:
            ctl->idle = FLAG_TRUE;
@@ -650,8 +650,7 @@ int parsecmdline (int argc /** argument count */,
         P(GT_("  -G, --pwmd-file   filename to use on the pwmd server\n"));
         P(GT_("  -O, --pinentry-timeout   seconds until pinentry is canceled\n"));
 #endif
-       P(GT_("  -U, --uidl        force the use of UIDLs (pop3 only)\n"));
+
        P(GT_("      --port        TCP port to connect to (obsolete, use --service)\n"));
        P(GT_("  -P, --service     TCP service to connect to (can be numeric TCP port)\n"));
        P(GT_("      --auth        authentication type (password/kerberos/ssh/otp)\n"));
diff --git a/pop3.c b/pop3.c
index dd8e46041e74728ee5286122351d25d482d5fd2f..fc3029a1d659ef83a74702d02e928b1f8a196aa8 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -259,7 +259,7 @@ static void set_peek_capable(struct query *ctl)
      * we have a means of reliably tracking which mail we need to
      * refetch should the connection abort in the middle.
      * fetchall forces RETR, as does keep without UIDL */
-    peek_capable = !ctl->fetchall && (!ctl->keep || ctl->server.uidl);
+    peek_capable = !ctl->fetchall;
 }
 
 static int pop3_getauth(int sock, struct query *ctl, char *greeting)
@@ -830,16 +830,10 @@ static int pop3_getrange(int sock,
     } else
        return(ok);
 
-    /*
-     * Newer, RFC-1725/1939-conformant POP servers may not have the LAST
-     * command.  We work as hard as possible to hide this, but it makes
-     * counting new messages intrinsically quadratic in the worst case.
-     */
+    /* unless fetching all mail, get UID list (UIDL) */
     last = 0;
     *newp = -1;
-    /* if there are messages, and UIDL is desired, use UIDL
-     * also use UIDL if fetchall is unset */
-    if (*countp > 0 && (!ctl->fetchall || ctl->server.uidl))
+    if (*countp > 0)
     {
        int fastuidl;
        char id [IDLEN+1];
@@ -862,23 +856,6 @@ static int pop3_getrange(int sock,
        else
            dofastuidl = 0;
 
-       if (!ctl->server.uidl) {
-           gen_send(sock, "LAST");
-           ok = pop3_ok(sock, buf);
-       } else
-           ok = 1;
-
-       if (ok == 0)
-       {
-           /* scan LAST reply */
-           if (sscanf(buf, "%d", &last) == 0)
-           {
-               report(stderr, GT_("protocol error\n"));
-               return(PS_ERROR);
-           }
-           *newp = (*countp - last);
-       }
-       else
        {
            /* do UIDL */
            if (dofastuidl)
@@ -1025,7 +1002,6 @@ static int pop3_is_old(int sock, struct query *ctl, int num)
            return(TRUE);
 
        /* in fast uidl, we manipulate the old list only! */
-
        if ((rec = find_uid_by_num(&ctl->oldsaved, num)))
        {
            /* we already have the id! */
index f20f2ef6775a4a51ebd2f8e18da0d1c239f48fa9..32659934ff4201d00b11c246292ad1a79020a490 100644 (file)
@@ -176,8 +176,8 @@ serv_option : AKA alias_list
                                            yyerror(GT_("SDPS not enabled."));
 #endif /* SDPS_ENABLE */
                                        }
-               | UIDL                  {current.server.uidl = FLAG_TRUE;}
-               | NO UIDL               {current.server.uidl  = FLAG_FALSE;}
+               | UIDL                  {/* EMPTY - removed in 6.4.0 */}
+               | NO UIDL               {/* EMPTY - removed in 6.4.0 */}
                | CHECKALIAS            {current.server.checkalias = FLAG_TRUE;}
                | NO CHECKALIAS         {current.server.checkalias  = FLAG_FALSE;}
                | SERVICE STRING        {
diff --git a/uid.c b/uid.c
index b69e662d52a410f76afbe08a97419a2e66e9033d..93bc77b58c9bad7dd1d2da784e5ff07e7571b6de 100644 (file)
--- a/uid.c
+++ b/uid.c
@@ -1,5 +1,5 @@
 /**
- * \file uid.c -- UIDL handling for POP3 servers without LAST
+ * \file uid.c -- UID list handling (currently, only for POP3)
  *
  * For license terms, see the file COPYING in this directory.
  */
 #include "sdump.h"
 
 /*
- * Machinery for handling UID lists live here.  This is mainly to support
- * RFC1725/RFC1939-conformant POP3 servers without a LAST command, but may also
- * be useful for making the IMAP4 querying logic UID-oriented, if a future
- * revision of IMAP forces me to.
+ * Machinery for handling UID lists live here.  This is currently used
+ * by POP3, but may also be useful for making the IMAP4 querying logic
+ * UID-oriented.
  *
  * These functions are also used by the rest of the code to maintain
  * string lists.