summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2009-10-31 15:23:14 -0400
committerBarry Warsaw2009-10-31 15:23:14 -0400
commit4f2ca4cb900ab891ebbbec56bd30b737304a3da7 (patch)
treeba7b5fb7b8b96c88705ccdedc5ab29e8e3b90286 /src
parent6ec26d074d923fa83b65b96c4904459d777781f9 (diff)
downloadmailman-4f2ca4cb900ab891ebbbec56bd30b737304a3da7.tar.gz
mailman-4f2ca4cb900ab891ebbbec56bd30b737304a3da7.tar.zst
mailman-4f2ca4cb900ab891ebbbec56bd30b737304a3da7.zip
Copy slightly modified code from smtp_direct.py for handling low level error.
Sadly, punting on tests for this for now.
Diffstat (limited to 'src')
-rw-r--r--src/mailman/mta/bulk.py11
-rw-r--r--src/mailman/mta/docs/bulk.txt4
2 files changed, 14 insertions, 1 deletions
diff --git a/src/mailman/mta/bulk.py b/src/mailman/mta/bulk.py
index be740c9cd..13a6fb369 100644
--- a/src/mailman/mta/bulk.py
+++ b/src/mailman/mta/bulk.py
@@ -153,4 +153,15 @@ class BulkDelivery:
# recipient -> (code, error)
(recipient, (error.smtp_code, error.smtp_error))
for recipient in recipients)
+ except (socket.error, IOError, smtplib.SMTPException) as error:
+ # MTA not responding, or other socket problems, or any other
+ # kind of SMTPException. In that case, nothing got delivered,
+ # so treat this as a temporary failure. We use error code 444
+ # for this (temporary, unspecified failure, cf RFC 5321).
+ log.error('%s low level smtp error: %s', message_id, error)
+ error = str(error)
+ refused = dict(
+ # recipient -> (code, error)
+ (recipient, (444, error))
+ for recipient in recipients)
return refused
diff --git a/src/mailman/mta/docs/bulk.txt b/src/mailman/mta/docs/bulk.txt
index bcce7e4c7..f1533ffe8 100644
--- a/src/mailman/mta/docs/bulk.txt
+++ b/src/mailman/mta/docs/bulk.txt
@@ -129,7 +129,7 @@ The next chunk will contain the .us (2) and .ca (1) domains.
The final chunk will contain the outliers, .xx (1) and .zz (2).
>>> len(chunks[5])
- 2
+ 2
>>> for address in sorted(chunks[5]):
... print address
paco@example.xx
@@ -397,3 +397,5 @@ Or there could be some other problem causing an SMTP response failure.
aperson@example.org 500 Error: SMTPResponseException
bperson@example.org 500 Error: SMTPResponseException
cperson@example.org 500 Error: SMTPResponseException
+
+XXX Untested: socket.error, IOError, smtplib.SMTPException.