summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mailman/mta/base.py1
-rw-r--r--src/mailman/mta/connection.py8
2 files changed, 6 insertions, 3 deletions
diff --git a/src/mailman/mta/base.py b/src/mailman/mta/base.py
index 38ed0d836..283101256 100644
--- a/src/mailman/mta/base.py
+++ b/src/mailman/mta/base.py
@@ -27,6 +27,7 @@ __all__ = [
import copy
+import socket
import logging
import smtplib
diff --git a/src/mailman/mta/connection.py b/src/mailman/mta/connection.py
index 36af7a06e..9e8f5cbc6 100644
--- a/src/mailman/mta/connection.py
+++ b/src/mailman/mta/connection.py
@@ -65,16 +65,18 @@ class Connection:
self._connection.connect(self._host, self._port)
self._session_count = self._sessions_per_connection
- def sendmail(self, envsender, recips, msgtext):
+ def sendmail(self, envsender, recipients, msgtext):
"""Mimic `smtplib.SMTP.sendmail`."""
if as_boolean(config.mailman.devmode):
# Force the recipients to the specified address, but still deliver
# to the same number of recipients.
- recips = [config.mta.devmode_recipient] * len(recips)
+ recipients = [config.mta.devmode_recipient] * len(recipients)
if self._connection is None:
self._connect()
try:
- results = self._connection.sendmail(envsender, recips, msgtext)
+ log.debug('envsender: %s, recipients: %s, size(msgtext): %s',
+ envsender, recipients, len(msgtext))
+ results = self._connection.sendmail(envsender, recipients, msgtext)
except smtplib.SMTPException:
# For safety, close this connection. The next send attempt will
# automatically re-open it. Pass the exception on up.