summaryrefslogtreecommitdiff
path: root/src/mailman/email/message.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-03-14 20:50:31 -0700
committerBarry Warsaw2012-03-14 20:50:31 -0700
commitab2158babc1b2f26e3c9c37b128cb949e726427d (patch)
tree489e14fed318c6007615e9b6c801c9e5782d6792 /src/mailman/email/message.py
parent7492328240dad73b300d49cca40030395b090808 (diff)
parent048d8b66972af87170803fd67f02f8c720694bbc (diff)
downloadmailman-ab2158babc1b2f26e3c9c37b128cb949e726427d.tar.gz
mailman-ab2158babc1b2f26e3c9c37b128cb949e726427d.tar.zst
mailman-ab2158babc1b2f26e3c9c37b128cb949e726427d.zip
Diffstat (limited to 'src/mailman/email/message.py')
-rw-r--r--src/mailman/email/message.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mailman/email/message.py b/src/mailman/email/message.py
index d7bf81055..efe8879b1 100644
--- a/src/mailman/email/message.py
+++ b/src/mailman/email/message.py
@@ -178,10 +178,20 @@ class UserNotification(Message):
self['To'] = recipients
self.recipients = set([recipients])
- def send(self, mlist, **_kws):
+ def send(self, mlist, add_precedence=True, **_kws):
"""Sends the message by enqueuing it to the 'virgin' queue.
This is used for all internally crafted messages.
+
+ :param mlist: The mailing list to send the message to.
+ :type mlist: `IMailingList`
+ :param add_precedence: Flag indicating whether a `Precedence: bulk`
+ header should be added to the message or not.
+ :type add_precedence: bool
+
+ This function also accepts arbitrary keyword arguments. The key/value
+ pairs for **kws is added to the metadata dictionary associated with
+ the enqueued message.
"""
# Since we're crafting the message from whole cloth, let's make sure
# this message has a Message-ID.
@@ -193,7 +203,7 @@ class UserNotification(Message):
# UserNotifications are typically for admin messages, and for messages
# other than list explosions. Send these out as Precedence: bulk, but
# don't override an existing Precedence: header.
- if 'precedence' not in self:
+ if 'precedence' not in self and add_precedence:
self['Precedence'] = 'bulk'
self._enqueue(mlist, **_kws)