From 336dd5c939307d1464071a2a04e5bd3bd1ca32de Mon Sep 17 00:00:00 2001 From: bwarsaw <> Date: Thu, 27 Nov 2003 00:05:47 +0000 Subject: bulkdeliver(): Include the Message-ID in the log message. --- Mailman/Handlers/SMTPDirect.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Mailman') diff --git a/Mailman/Handlers/SMTPDirect.py b/Mailman/Handlers/SMTPDirect.py index c61336fe..e1607358 100644 --- a/Mailman/Handlers/SMTPDirect.py +++ b/Mailman/Handlers/SMTPDirect.py @@ -345,15 +345,17 @@ def bulkdeliver(mlist, msg, msgdata, envsender, failures, conn): msgtext = msg.as_string() refused = {} recips = msgdata['recips'] + msgid = msg['message-id'] try: # Send the message refused = conn.sendmail(envsender, recips, msgtext) except smtplib.SMTPRecipientsRefused, e: - syslog('smtp-failure', 'All recipients refused: %s', e) + syslog('smtp-failure', 'All recipients refused: %s, msgid: %s', + e, msgid refused = e.recipients except smtplib.SMTPResponseException, e: - syslog('smtp-failure', 'SMTP session failure: %s, %s', - e.smtp_code, smtp_error) + syslog('smtp-failure', 'SMTP session failure: %s, %s, msgid: %s', + e.smtp_code, smtp_error, msgid) # If this was a permanent failure, don't add the recipients to the # refused, because we don't want them to be added to failures. # Otherwise, if the MTA rejects the message because of the message @@ -368,7 +370,7 @@ def bulkdeliver(mlist, msg, msgdata, envsender, failures, conn): # 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. - syslog('smtp-failure', 'Low level smtp connection error: %s', e) + syslog('smtp-failure', 'Low level smtp error: %s, msgid: %s', e, msgid) error = str(e) for r in recips: refused[r] = (-1, error) -- cgit v1.2.3