diff options
| author | manuel <manuel@mausz.at> | 2014-05-20 02:14:50 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2014-05-20 02:14:50 +0200 |
| commit | 3284e61d7a7a49620e64c7d634776f8bcf4f8119 (patch) | |
| tree | 5afa69959a1910936bbf5b0a2f050f5104894c84 | |
| parent | d386103631ccee7c6b5d558311816c6aecc372e4 (diff) | |
| download | qmail-3284e61d7a7a49620e64c7d634776f8bcf4f8119.tar.gz qmail-3284e61d7a7a49620e64c7d634776f8bcf4f8119.tar.bz2 qmail-3284e61d7a7a49620e64c7d634776f8bcf4f8119.zip | |
Treat ECONNREFUSED the same as ETIMEDOUT
After an SMTP connection attempt times out, qmail-remote records
the relevant IP address. If the same address fails again (after
at least two minutes with no intervening successful connections),
qmail-remote assumes that further attempts will fail for at least
another hour.
| -rw-r--r-- | error.c | 7 | ||||
| -rw-r--r-- | error.h | 1 | ||||
| -rw-r--r-- | qmail-remote.c | 2 |
3 files changed, 9 insertions, 1 deletions
| @@ -93,3 +93,10 @@ EACCES; | |||
| 93 | #else | 93 | #else |
| 94 | -13; | 94 | -13; |
| 95 | #endif | 95 | #endif |
| 96 | |||
| 97 | int error_refused = | ||
| 98 | #ifdef ECONNREFUSED | ||
| 99 | ECONNREFUSED; | ||
| 100 | #else | ||
| 101 | -14; | ||
| 102 | #endif | ||
| @@ -16,6 +16,7 @@ extern int error_again; | |||
| 16 | extern int error_pipe; | 16 | extern int error_pipe; |
| 17 | extern int error_perm; | 17 | extern int error_perm; |
| 18 | extern int error_acces; | 18 | extern int error_acces; |
| 19 | extern int error_refused; | ||
| 19 | 20 | ||
| 20 | extern char *error_str(); | 21 | extern char *error_str(); |
| 21 | extern int error_temp(); | 22 | extern int error_temp(); |
diff --git a/qmail-remote.c b/qmail-remote.c index dc00d08..b865b4d 100644 --- a/qmail-remote.c +++ b/qmail-remote.c | |||
| @@ -951,7 +951,7 @@ char **argv; | |||
| 951 | #endif | 951 | #endif |
| 952 | smtp(); /* only returns when the next MX is to be tried */ | 952 | smtp(); /* only returns when the next MX is to be tried */ |
| 953 | } | 953 | } |
| 954 | tcpto_err(&ip.ix[i].ip,errno == error_timeout); | 954 | tcpto_err(&ip.ix[i].ip,errno == error_timeout || errno == error_refused); |
| 955 | close(smtpfd); | 955 | close(smtpfd); |
| 956 | } | 956 | } |
| 957 | 957 | ||
