diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/mta/bulk.py | 11 | ||||
| -rw-r--r-- | src/mailman/mta/docs/bulk.txt | 4 |
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. |
