diff options
| author | Barry Warsaw | 2009-10-31 14:12:19 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-10-31 14:12:19 -0400 |
| commit | cac646019303ffe85cfac4c00eca7d44f634a03d (patch) | |
| tree | 7e8f85891e81e6f30f905aba2a85640756868c9a /src/mailman/mta/bulk.py | |
| parent | 19e6548e3df4719455ab1ed2a242acbc3e38d9e9 (diff) | |
| download | mailman-cac646019303ffe85cfac4c00eca7d44f634a03d.tar.gz mailman-cac646019303ffe85cfac4c00eca7d44f634a03d.tar.zst mailman-cac646019303ffe85cfac4c00eca7d44f634a03d.zip | |
Diffstat (limited to 'src/mailman/mta/bulk.py')
| -rw-r--r-- | src/mailman/mta/bulk.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mailman/mta/bulk.py b/src/mailman/mta/bulk.py index ff00f3d20..21bbd1713 100644 --- a/src/mailman/mta/bulk.py +++ b/src/mailman/mta/bulk.py @@ -25,6 +25,9 @@ __all__ = [ ] +import logging +import smtplib + from itertools import chain from zope.interface import implements @@ -34,6 +37,8 @@ from mailman.interfaces.mta import IMailTransportAgentDelivery from mailman.mta.connection import Connection +log = logging.getLogger('mailman.smtp') + # A mapping of top-level domains to bucket numbers. The zeroth bucket is # reserved for everything else. At one time, these were the most common # domains. @@ -134,6 +139,12 @@ class BulkDelivery: else mlist.bounces_address) msg['Sender'] = sender msg['Errors-To'] = sender + message_id = msg['message-id'] for recipients in self.chunkify(msgdata['recipients']): - self._connection.sendmail( - 'foo@example.com', recipients, msg.as_string()) + try: + refused = self._connection.sendmail( + sender, recipients, msg.as_string()) + except smtplib.SMTPRecipientsRefused as error: + log.error('%s recipients refused: %s', message_id, error) + refused = error.recipients + return refused |
