diff options
| author | bwarsaw | 2001-07-10 05:38:15 +0000 |
|---|---|---|
| committer | bwarsaw | 2001-07-10 05:38:15 +0000 |
| commit | 175f7a82720ecf22eb637e0d7c52812f1c4d498c (patch) | |
| tree | b8462138eddcecc56c243b3f4a3d227579bd87ff /Mailman/Bouncer.py | |
| parent | 7076573bec25a368f26d29b42a8ad63d39b461a6 (diff) | |
| download | mailman-175f7a82720ecf22eb637e0d7c52812f1c4d498c.tar.gz mailman-175f7a82720ecf22eb637e0d7c52812f1c4d498c.tar.zst mailman-175f7a82720ecf22eb637e0d7c52812f1c4d498c.zip | |
Diffstat (limited to 'Mailman/Bouncer.py')
| -rw-r--r-- | Mailman/Bouncer.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Mailman/Bouncer.py b/Mailman/Bouncer.py index 9d1abf46f..0a6f44559 100644 --- a/Mailman/Bouncer.py +++ b/Mailman/Bouncer.py @@ -25,6 +25,9 @@ import sys import time +from mimelib.Text import Text +from mimelib.RFC822 import RFC822 + from Mailman import mm_cfg from Mailman import Errors from Mailman import Utils @@ -318,3 +321,19 @@ Bad admin recipient: %s''', self.internal_name(), addr) self.ClearBounceInfo(addr) self.Save() return Errors.MMNoSuchUserError, 1 + + def BounceMessage(self, msg, msgdata, e): + # Bounce a message back to the sender, with an error message if + # provided in the exception argument. + sender = msg.get_sender() + # Currently we always craft bounces as MIME messages. + bmsg = Message.UserNotification(msg.get_sender(), + self.GetOwnerEmail(), + e.subject()) + bmsg.addheader('Content-Type', 'multipart/mixed') + bmsg['MIME-Version'] = '1.0' + txt = Text(e.details(), + _charset=Utils.GetCharSet(self.preferred_language)) + bmsg.add_payload(txt) + bmsg.add_payload(RFC822(msg)) + bmsg.send(self) |
