summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2016-11-24 00:45:36 -0500
committerBarry Warsaw2016-11-24 00:45:36 -0500
commitf153d9f2926b1cb538eaf6447bae8c45473e658e (patch)
tree6728ce78c9d86f41bb57d08800d5c923fa0e0a76 /src
parentd681f5a31c3239e37735aa62111baa7e60c41241 (diff)
downloadmailman-f153d9f2926b1cb538eaf6447bae8c45473e658e.tar.gz
mailman-f153d9f2926b1cb538eaf6447bae8c45473e658e.tar.zst
mailman-f153d9f2926b1cb538eaf6447bae8c45473e658e.zip
Sort the recipients list.
Diffstat (limited to 'src')
-rw-r--r--src/mailman/mta/base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mailman/mta/base.py b/src/mailman/mta/base.py
index a04ee4b46..679faefd5 100644
--- a/src/mailman/mta/base.py
+++ b/src/mailman/mta/base.py
@@ -63,9 +63,11 @@ class BaseDelivery:
# Do the actual sending.
sender = self._get_sender(mlist, msg, msgdata)
message_id = msg['message-id']
+ # Since the recipients can be a set or a list, sort the recipients by
+ # email address for predictability and testability.
try:
refused = self._connection.sendmail(
- sender, recipients, msg.as_string())
+ sender, sorted(recipients), msg.as_string())
except smtplib.SMTPRecipientsRefused as error:
log.error('%s recipients refused: %s', message_id, error)
refused = error.recipients