diff options
| author | klm | 1998-10-23 03:58:13 +0000 |
|---|---|---|
| committer | klm | 1998-10-23 03:58:13 +0000 |
| commit | e7cb97b417c6e8c25e43a9518d49629b5646a2da (patch) | |
| tree | 0dc8dc2fe81d58cb3644797d0a73d963605517f1 /Mailman/Deliverer.py | |
| parent | 7a64a6b9c355b88d7b049ab6583b3bd52ce24a9a (diff) | |
| download | mailman-e7cb97b417c6e8c25e43a9518d49629b5646a2da.tar.gz mailman-e7cb97b417c6e8c25e43a9518d49629b5646a2da.tar.zst mailman-e7cb97b417c6e8c25e43a9518d49629b5646a2da.zip | |
Diffstat (limited to 'Mailman/Deliverer.py')
| -rw-r--r-- | Mailman/Deliverer.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/Mailman/Deliverer.py b/Mailman/Deliverer.py index dcce745cc..2651e6d2a 100644 --- a/Mailman/Deliverer.py +++ b/Mailman/Deliverer.py @@ -19,6 +19,7 @@ import string, os, sys +import operator import mm_cfg import Errors import Utils @@ -34,17 +35,25 @@ class Deliverer: add_headers=[]): if not sender: sender = self.GetAdminEmail() - alladd = add_headers + ['X-MailmanVersion: %s\n' % mm_cfg.VERSION] + if (add_headers + and not reduce(operator.__or__, + map(lambda x: string.find(string.lower(x), + "list-id:")==0, + add_headers))): + # No "list-id" header already on add_headers: + add_headers.append('List-Id: %s\n' % self.GetListIdentifier()) + alladd = add_headers + ['X-Mailman-Version: %s\n' % mm_cfg.VERSION] Utils.SendTextToUser(subject, text, recipient, sender, add_headers=alladd) def DeliverToUser(self, msg, recipient): # This method assumes the sender is the one given by the message. - Utils.DeliverToUser(msg, recipient, - add_headers=['Errors-To: %s\n' - % Self.GetAdminEmail(), - 'X-MailmanVersion: %s\n' - % mm_cfg.VERSION]) + add_headers = [] + if not msg.getheader('list-id'): + add_headers.append('List-Id: %s\n' % self.GetListIdentifier()) + add_headers.append('Errors-To: %s\n' % self.GetAdminEmail()) + add_headers.append('X-Mailman-Version: %s\n' % mm_cfg.VERSION) + Utils.DeliverToUser(msg, recipient, add_headers=add_headers) def QuotePeriods(self, text): return string.join(string.split(text, '\n.\n'), '\n .\n') @@ -97,9 +106,11 @@ class Deliverer: del msg['reply-to'] msg.headers.append('Reply-To: %s\n' % self.GetListEmail()) msg.headers.append('Sender: %s\n' % self.GetAdminEmail()) + if not msg.getheader('list-id'): + msg.headers.append('List-Id: %s\n' % self.GetListIdentifier()) msg.headers.append('Errors-To: %s\n' % self.GetAdminEmail()) msg.headers.append('X-BeenThere: %s\n' % self.GetListEmail()) - msg.headers.append('X-MailmanVersion: %s\n' % mm_cfg.VERSION) + msg.headers.append('X-Mailman-Version: %s\n' % mm_cfg.VERSION) cmd = "%s %s" % (mm_cfg.PYTHON, os.path.join(mm_cfg.SCRIPTS_DIR, "deliver")) |
