From aec7c43d8a1798eb1b134186d0f1b5d010fb7942 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sun, 8 Jan 2006 02:06:36 +0000 Subject: Remove excess set_peek_capable() call. Move Maillennium check to before authentication checks to ALWAYS run it. Fix operator precedence bug introduced with adding the "print once" feature and that suppressed the warning. svn path=/branches/BRANCH_6-3/; revision=4614 --- pop3.c | 53 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'pop3.c') diff --git a/pop3.c b/pop3.c index facd09fc..e405ea97 100644 --- a/pop3.c +++ b/pop3.c @@ -313,6 +313,31 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting) has_ssl = FALSE; #endif /* SSL_ENABLE */ + /* Set this up before authentication quits early. */ + set_peek_capable(ctl); + /* + * 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. + * + * (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")) { + 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; + } if (ctl->server.authenticate == A_SSH) { return PS_SUCCESS; } @@ -610,31 +635,6 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting) sleep(3); /* to be _really_ safe, probably need sleep(5)! */ #endif - set_peek_capable(ctl); - /* - * 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. - * - * (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")) { - 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; - } - /* we're approved */ return(PS_SUCCESS); } @@ -1300,8 +1300,7 @@ int doPOP3 (struct query *ctl) return(PS_SYNTAX); } #endif /* MBOX */ - set_peek_capable(ctl); /* XXX FIXME: is this needed or do we always - call this from pop3_getauth anyways? */ + return(do_protocol(ctl, &pop3)); } #endif /* POP3_ENABLE */ -- cgit v1.2.3