summaryrefslogtreecommitdiff
path: root/src/mailman/mta/bulk.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/mta/bulk.py')
-rw-r--r--src/mailman/mta/bulk.py15
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