]> Pileus Git - ~andy/fetchmail/commitdiff
Revise Maillennium workaround so that it is reported only once per server, in daemon...
authorMatthias Andree <matthias.andree@gmx.de>
Sat, 7 Jan 2006 21:56:35 +0000 (21:56 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Sat, 7 Jan 2006 21:56:35 +0000 (21:56 -0000)
svn path=/branches/BRANCH_6-3/; revision=4613

fetchmail.h
pop3.c

index a638df9e43123c9651ecc62f50cf6e49ab067129..dfafd2b51146d4e6cad560fb281f79a56f2129fb 100644 (file)
@@ -277,8 +277,16 @@ struct hostdata            /* shared among all user connections to given server */
     size_t trueaddr_len;               /* size of trueaddr data */
     struct hostdata *lead_server;      /* ptr to lead query for this server */
     int esmtp_options;
+    int workarounds;                   /* track which workarounds the user was warned about */
 };
 
+/*
+ * bit flags to set in workarounds after the corresponding warning,
+ * which we assume to be server-specific, has been printed,
+ * so we don't spam our users in daemon mode.
+ */
+#define WKA_TOP (1L << 0)              /* Maillennium TOP -> RETR override warning */
+
 struct query
 {
     /* mailserver connection controls */
diff --git a/pop3.c b/pop3.c
index df85e3e6a8d9be2838478cd22ea4f3144d25541c..facd09fc4d5a5470b9c2c40f263103bc6b2b6beb 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -611,10 +611,27 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting)
 #endif
 
     set_peek_capable(ctl);
-    /* comcast's Maillennium POP3/PROXY is full of bugs and truncates
-     * TOP replies after c. 80 kByte, so disable TOP. */
+    /*
+     * The "Maillennium POP3/PROXY server" deliberately truncates
+     * TOP replies after c. 64 or 80 kByte (we have varying reports), so
+     * disable TOP. Comcast once spewed marketing babble to the extent
+     * of protecting Outlook -- pretty overzealous to break a protocol
+     * for that that Microsoft could have read, too. Comcast aren't
+     * alone in using this software though.
+     * <http://lists.ccil.org/pipermail/fetchmail-friends/2004-April/008523.html>
+     * (Thanks to Ed Wilts for reminding me of that.)
+     *
+     * The warning is printed once per server, until fetchmail exits.
+     * It will be suppressed when --fetchall or other circumstances make
+     * us use RETR anyhow.
+     *
+     * Matthias Andree
+     */
     if (peek_capable && strstr(greeting, "Maillennium POP3/PROXY server")) {
-       report(stdout, GT_("Warning: Maillennium POP3/PROXY server found, using RETR command.\n"));
+       if (ctl->server.workarounds & WKA_TOP == 0) {
+           report(stdout, GT_("Warning: Maillennium POP3/PROXY server found, using RETR command.\n"));
+           ctl->server.workarounds |= WKA_TOP;
+       }
        peek_capable = 0;
     }