aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1999-09-28 21:25:11 +0000
committerEric S. Raymond <esr@thyrsus.com>1999-09-28 21:25:11 +0000
commita53713a0f8585c6313efd0975cc896788c6ca898 (patch)
tree0d37152fe0df266bb35662709898f505f29e172e
parent6df2d8474695b9d1fd5c477c8c43f3cd0e038fe4 (diff)
downloadfetchmail-a53713a0f8585c6313efd0975cc896788c6ca898.tar.gz
fetchmail-a53713a0f8585c6313efd0975cc896788c6ca898.tar.bz2
fetchmail-a53713a0f8585c6313efd0975cc896788c6ca898.zip
Tolerate more than one authorization failure.
svn path=/trunk/; revision=2621
-rw-r--r--NEWS4
-rw-r--r--driver.c5
-rw-r--r--fetchmail.h1
-rw-r--r--tunable.h3
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