diff options
| author | bwarsaw | 1999-11-24 19:30:23 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-11-24 19:30:23 +0000 |
| commit | d531f150095caf72654a3acf5b967c9a4c6e4bf1 (patch) | |
| tree | 8afa3e15d37da719f651213eb5d2440862fb21d0 | |
| parent | c7b3790a4199d717901b2b7feeb6372dc7c6870c (diff) | |
| download | mailman-d531f150095caf72654a3acf5b967c9a4c6e4bf1.tar.gz mailman-d531f150095caf72654a3acf5b967c9a4c6e4bf1.tar.zst mailman-d531f150095caf72654a3acf5b967c9a4c6e4bf1.zip | |
First, because this module is going to modify the Sender: field for
outgoing mail, we stash the original value of msg.GetSender() in a
message object attribute msg.original_sender. This is used by the
Acknowledge module.
Second, only perform subject prefix prepending if not msg.isdigest an
dnot msg.fastrack. I.e. the message isn't a pre-crafted digest
message, and it's not being fast tracked via HandlerAPI.DeliverToUser.
Fast tracking means it's being delivered to a single address and not
to the general list subscribership.
| -rw-r--r-- | Mailman/Handlers/CookHeaders.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py index 511a009a6..5efa26d61 100644 --- a/Mailman/Handlers/CookHeaders.py +++ b/Mailman/Handlers/CookHeaders.py @@ -25,12 +25,18 @@ from Mailman import mm_cfg def process(mlist, msg): + # Because we're going to modify various important headers in the email + # message, we want to save some of the information as attributes for + # later. Specifically, the sender header will get waxed, but we need it + # for the Acknowledge module later. + msg.original_sender = msg.GetSender() subject = msg.getheader('subject') adminaddr = mlist.GetAdminEmail() - if not getattr(msg, 'isdigest', 0): - # add the subject prefix unless the message is a digest. we assume - # all digests have an appropriate subject header added by the ToDigest - # module. + if not getattr(msg, 'isdigest', 0) and not getattr(msg, 'fastrack', 0): + # Add the subject prefix unless the message is a digest or is being + # fast tracked (e.g. internally crafted, delivered to a single user + # such as the list admin). We assume all digests have an appropriate + # subject header added by the ToDigest module. prefix = mlist.subject_prefix # we purposefully leave no space b/w prefix and subject! if not subject: @@ -57,8 +63,8 @@ def process(mlist, msg): # None of these headers are added if they already exist if not msg.get('x-mailman-version'): msg['X-Mailman-Version'] = mm_cfg.VERSION - # semi-controversial: some don't want this included at all, others - # want the value to be `list' + # Semi-controversial: some don't want this included at all, others + # want the value to be `list'. if not msg.get('precedence'): msg['Precedence'] = 'bulk' # |
