summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruce Guenter <bruce@untroubled.org>2018-01-17 09:05:53 -0600
committerBruce Guenter <bruce@untroubled.org>2018-01-17 10:45:52 -0600
commited9fc9667563840571600ceb201bf7f2dac3aafb (patch)
tree08b782f726186da565278f9da7ff915f60f4dcb1 /lib
parent8f12d165d04451201f09a04686c2287c22d214f5 (diff)
protocols/smtp: Fix treating auth failure as a permanent failure
A typo in the SMTP configuration would cause messages to be rejected due to the AUTH command being failed. This would result in password typos causing messages to be bounced. This change adds a new temporary error code specifically for authentication failures, which will result in retries (with backoff) instead of bounces. Thanks to Fejes József <jozsef.fejes@gmail.com> for identifying this problem. This also adds tests for SMTP AUTH which had been missing.
Diffstat (limited to 'lib')
-rw-r--r--lib/errcodes.cc1
-rw-r--r--lib/errcodes.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/errcodes.cc b/lib/errcodes.cc
index 84b9f76..e2454e6 100644
--- a/lib/errcodes.cc
+++ b/lib/errcodes.cc
@@ -44,6 +44,7 @@ const char* errorstr(int code)
case ERR_MSG_REFUSED: return "Server refused the message";
case ERR_MSG_PERMFAIL: return "Permanent error in sending the message";
case ERR_BIND_FAILED: return "Failed to bind source address";
+ case ERR_AUTH_FAILED: return "Failed to authenticate to server";
}
return (code & ERR_PERMANENT_FLAG)
? "Unspecified permanent error"
diff --git a/lib/errcodes.h b/lib/errcodes.h
index 94564ee..eaa1fa9 100644
--- a/lib/errcodes.h
+++ b/lib/errcodes.h
@@ -20,6 +20,7 @@
#define ERR_UNKNOWN 17 // Arbitrary error code
#define ERR_CONFIG 18 // Error reading a config file
#define ERR_BIND_FAILED 19 // Failed to bind source address
+#define ERR_AUTH_FAILED 20 // Failed to authenticate to server
// Permanent errors
#define ERR_GHBN_FATAL 33 // gethostbyname failed with NO_RECOVERY