diff options
author | bwarsaw <> | 2003-12-26 22:55:45 +0000 |
---|---|---|
committer | bwarsaw <> | 2003-12-26 22:55:45 +0000 |
commit | 1dd9d148509cc2b47113e0381e67d74f3eb20460 (patch) | |
tree | 768756a6e0b3ce1d260570e135603ba404635235 /Mailman | |
parent | 05633b8758c2f48b0f3c9a558c956b458b19af18 (diff) | |
download | mailman2-1dd9d148509cc2b47113e0381e67d74f3eb20460.tar.gz mailman2-1dd9d148509cc2b47113e0381e67d74f3eb20460.tar.xz mailman2-1dd9d148509cc2b47113e0381e67d74f3eb20460.zip |
hold_for_approval(): Another part of TK's patch # 865661. Encode the
subject header in the list's preferred character set and make sure it
is all on one line, when sent back to the original author.
Diffstat (limited to '')
-rw-r--r-- | Mailman/Handlers/Hold.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Mailman/Handlers/Hold.py b/Mailman/Handlers/Hold.py index c3a6d6f8..5953aacc 100644 --- a/Mailman/Handlers/Hold.py +++ b/Mailman/Handlers/Hold.py @@ -197,6 +197,12 @@ def hold_for_approval(mlist, msg, msgdata, exc): exc = exc() listname = mlist.real_name sender = msgdata.get('sender', msg.get_sender()) + usersubject = msg.get('subject') + charset = Utils.GetCharSet(mlist.preferred_language) + if usersubject: + usersubject = Utils.oneline(usersubject, charset) + else: + usersubject = _('(no subject)') message_id = msg.get('message-id', 'n/a') owneraddr = mlist.GetOwnerEmail() adminaddr = mlist.GetBouncesEmail() @@ -212,7 +218,7 @@ def hold_for_approval(mlist, msg, msgdata, exc): 'hostname' : mlist.host_name, 'reason' : _(reason), 'sender' : sender, - 'subject' : msg.get('subject', _('(no subject)')), + 'subject' : usersubject, 'admindb_url': mlist.GetScriptURL('admindb', absolute=1), } # We may want to send a notification to the original sender too @@ -247,7 +253,6 @@ def hold_for_approval(mlist, msg, msgdata, exc): lang = mlist.preferred_language charset = Utils.GetCharSet(lang) # We need to regenerate or re-translate a few values in d - usersubject = msg.get('subject', _('(no subject)')) d['reason'] = _(reason) d['subject'] = usersubject # craft the admin notification message and deliver it |