summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2016-11-24 00:45:36 -0500
committerBarry Warsaw2016-11-24 11:54:45 -0500
commit0367438027c6c4b9b6806c1b7243263c9fb3f0c6 (patch)
treed11313ac9636bea1f2f2cd818608ebce15b9db89 /src
parentcdda1d3231b8a74854936e89430c3da89c9c72b1 (diff)
downloadmailman-0367438027c6c4b9b6806c1b7243263c9fb3f0c6.tar.gz
mailman-0367438027c6c4b9b6806c1b7243263c9fb3f0c6.tar.zst
mailman-0367438027c6c4b9b6806c1b7243263c9fb3f0c6.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