summaryrefslogtreecommitdiff
path: root/src/mailman/mta/bulk.py
diff options
context:
space:
mode:
authorBarry Warsaw2009-10-24 16:49:33 -0400
committerBarry Warsaw2009-10-24 16:49:33 -0400
commit19e6548e3df4719455ab1ed2a242acbc3e38d9e9 (patch)
treeffae2472bb9c49ee53b5cba37213c74c33284b4c /src/mailman/mta/bulk.py
parent7f5818a6c2356211c41c9fcd7dd8fa3b5c4ac6f6 (diff)
downloadmailman-19e6548e3df4719455ab1ed2a242acbc3e38d9e9.tar.gz
mailman-19e6548e3df4719455ab1ed2a242acbc3e38d9e9.tar.zst
mailman-19e6548e3df4719455ab1ed2a242acbc3e38d9e9.zip
Diffstat (limited to 'src/mailman/mta/bulk.py')
-rw-r--r--src/mailman/mta/bulk.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mailman/mta/bulk.py b/src/mailman/mta/bulk.py
index 2b400e8b5..ff00f3d20 100644
--- a/src/mailman/mta/bulk.py
+++ b/src/mailman/mta/bulk.py
@@ -115,6 +115,25 @@ class BulkDelivery:
recipients = msgdata.get('recipients')
if recipients is None:
return
+ # Blow away any existing Sender and Errors-To headers and substitute
+ # our own. Our interpretation of RFC 5322 $3.6.2 is that Mailman is
+ # the "agent responsible for actual transmission of the message"
+ # because what we send to list members is different than what the
+ # original author sent. RFC 2076 says Errors-To is "non-standard,
+ # discouraged" but we include it for historical purposes.
+ del msg['sender']
+ del msg['errors-to']
+ # The message metadata can override the calculation of the sender, but
+ # otherwise it falls to the list's -bounces robot. If this message is
+ # not intended for any specific mailing list, the site owner's address
+ # is used.
+ sender = msgdata.get('sender')
+ if sender is None:
+ sender = (config.mailman.site_owner
+ if mlist is None
+ else mlist.bounces_address)
+ msg['Sender'] = sender
+ msg['Errors-To'] = sender
for recipients in self.chunkify(msgdata['recipients']):
self._connection.sendmail(
'foo@example.com', recipients, msg.as_string())