summaryrefslogtreecommitdiff
path: root/Mailman/Queue/BounceRunner.py
diff options
context:
space:
mode:
authorbwarsaw2002-10-08 00:06:22 +0000
committerbwarsaw2002-10-08 00:06:22 +0000
commita1bc4fa17b7d73e13165a1129c4ec60cdb672a02 (patch)
tree2ff66729df43c03184bf54f5ca050e2016c9eae4 /Mailman/Queue/BounceRunner.py
parent7e5beaf9665444591b0c1d889b220acff240a928 (diff)
downloadmailman-a1bc4fa17b7d73e13165a1129c4ec60cdb672a02.tar.gz
mailman-a1bc4fa17b7d73e13165a1129c4ec60cdb672a02.tar.zst
mailman-a1bc4fa17b7d73e13165a1129c4ec60cdb672a02.zip
maybe_forward(): Refactor forwarding logic into ForwardMessage()
method on the MailList instance.
Diffstat (limited to 'Mailman/Queue/BounceRunner.py')
-rw-r--r--Mailman/Queue/BounceRunner.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/Mailman/Queue/BounceRunner.py b/Mailman/Queue/BounceRunner.py
index 8face3653..1c6d41ace 100644
--- a/Mailman/Queue/BounceRunner.py
+++ b/Mailman/Queue/BounceRunner.py
@@ -169,24 +169,16 @@ def maybe_forward(mlist, msg, msgdata, outq):
# Does the list owner want to get non-matching bounce messages?
# If not, simply discard it.
if mlist.bounce_unrecognized_goes_to_list_owner:
- recips = mlist.owner[:]
- recips.extend(mlist.moderator)
- # Wrap the message as an attachment
- text = MIMEText(Utils.wrap(_("""\
+ mlist.ForwardMessage(
+ msg,
+ text=_("""\
The attached message was received as a bounce, but either the bounce format
was not recognized, or no member addresses could be extracted from it. You,
as the list administrators have requested to receive all unrecognized bounce
messages.
-""")),
- _charset=Utils.GetCharSet(mlist.preferred_language))
- attachment = MIMEMessage(msg)
- notice = UserNotification(recips, mlist.GetBouncesEmail(),
- _('Uncaught bounce notification'))
- notice.set_type('multipart/mixed')
- notice.attach(text)
- notice.attach(attachment)
- notice.send(mlist)
+"""),
+ subject=_('Uncaught bounce notification'))
syslog('bounce', 'forwarding unrecognized, message-id: %s',
msg.get('message-id', 'n/a'))
else: