summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mailman/app/docs/message.rst38
-rw-r--r--src/mailman/email/message.py2
2 files changed, 39 insertions, 1 deletions
diff --git a/src/mailman/app/docs/message.rst b/src/mailman/app/docs/message.rst
index 3e3293196..11ab32b22 100644
--- a/src/mailman/app/docs/message.rst
+++ b/src/mailman/app/docs/message.rst
@@ -46,3 +46,41 @@ The message will end up in the `virgin` queue.
Precedence: bulk
<BLANKLINE>
I needed to tell you this.
+
+The message above got a Precedence: bulk header added by default. If the
+message we're sending already has a Precedence: header, it shouldn't be
+changed.
+
+ >>> del msg['precedence']
+ >>> msg['Precedence'] = 'list'
+ >>> msg.send(mlist)
+
+Again, the message will end up in the `virgin` queue but with our Precedence:
+header.
+
+ >>> switchboard = config.switchboards['virgin']
+ >>> len(switchboard.files)
+ 1
+ >>> filebase = switchboard.files[0]
+ >>> qmsg, qmsgdata = switchboard.dequeue(filebase)
+ >>> switchboard.finish(filebase)
+ >>> qmsg['precedence'] == 'list'
+ True
+
+Sometimes we want to send the message without a Precedence: header such as
+when we send a probe message.
+
+ >>> del msg['precedence']
+ >>> msg.send(mlist, noprecedence=True)
+
+Again, the message will end up in the `virgin` queue but without the
+Precedence: header.
+
+ >>> switchboard = config.switchboards['virgin']
+ >>> len(switchboard.files)
+ 1
+ >>> filebase = switchboard.files[0]
+ >>> qmsg, qmsgdata = switchboard.dequeue(filebase)
+ >>> switchboard.finish(filebase)
+ >>> 'precedence' in qmsg
+ False
diff --git a/src/mailman/email/message.py b/src/mailman/email/message.py
index 7f7ee66ed..28d94523f 100644
--- a/src/mailman/email/message.py
+++ b/src/mailman/email/message.py
@@ -193,7 +193,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 or not noprecedence:
+ if 'precedence' not in self and not noprecedence:
self['Precedence'] = 'bulk'
self._enqueue(mlist, **_kws)