From a53713a0f8585c6313efd0975cc896788c6ca898 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 28 Sep 1999 21:25:11 +0000 Subject: Tolerate more than one authorization failure. svn path=/trunk/; revision=2621 --- NEWS | 4 +++- driver.c | 5 +++-- fetchmail.h | 1 + tunable.h | 3 +++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 98b7eaff..033a581d 100644 --- a/NEWS +++ b/NEWS @@ -11,8 +11,10 @@ fetchmail-5.1.1 (): * -A has been retired (goes with authenticate -> preauthenticate change). * Check for both fetchall and keep on in daemon mode; reject this. * Fixed a logfile bug dumping IMAP-LOGIN and IMAP-CRAM-MD5. +* Tolerate a tunable constant number of authorization failures before + complaining and wedging. -There are 262 people on fetchmail-friends and 443 on fetchmail-announce. +There are 266 people on fetchmail-friends and 447 on fetchmail-announce. ------------------------------------------------------------------------------ fetchmail-5.1.0 (Wed Sep 22 01:27:42 EDT 1999), 17767 lines: diff --git a/driver.c b/driver.c index cf18ae71..38da2d87 100644 --- a/driver.c +++ b/driver.c @@ -1653,10 +1653,11 @@ const int maxfetch; /* maximum number of messages to fetch */ /* * If we're running in background, try to mail the * calling user a heads-up about the authentication - * failure the first time it happens. + * failure once it looks like this isn't a fluke + * due to the server being temporarily inaccessible. */ if (run.poll_interval - && !ctl->wedged + && ctl->authfailcount++ > MAX_AUTHFAILS && !open_warning_by_mail(ctl, (struct msgblk *)NULL)) { stuff_warning(ctl, diff --git a/fetchmail.h b/fetchmail.h index 401db928..161d14af 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -263,6 +263,7 @@ struct query flag active; /* should we actually poll this server? */ const char *destaddr; /* destination host for this query */ int errcount; /* count transient errors in last pass */ + int authfailcount; /* count of authorization failures */ int wedged; /* wedged by auth failures or timeouts? */ char *smtphost; /* actual SMTP host we connected to */ int smtp_socket; /* socket descriptor for SMTP connection */ diff --git a/tunable.h b/tunable.h index b6abc5f5..6202e7bd 100644 --- a/tunable.h +++ b/tunable.h @@ -16,5 +16,8 @@ /* maximum consecutive lock-busy errors to accept */ #define MAX_LOCKOUTS 5 +/* maximum consecutive authentication failures to accept */ +#define MAX_AUTHFAILS 10 + /* default skipped message warning interval in seconds */ #define WARNING_INTERVAL 3600 -- cgit v1.2.3