summaryrefslogtreecommitdiff
path: root/Mailman/Queue/CommandRunner.py
diff options
context:
space:
mode:
authorbwarsaw2002-05-28 03:10:15 +0000
committerbwarsaw2002-05-28 03:10:15 +0000
commit4164a2ea7c53a030d5d33f853e14fffd3f55af18 (patch)
treeac44e012c6d0f1cb0048a9611cdc2abc9f74921d /Mailman/Queue/CommandRunner.py
parent90837508516ced9322bb031a87c520a4db97ba73 (diff)
downloadmailman-4164a2ea7c53a030d5d33f853e14fffd3f55af18.tar.gz
mailman-4164a2ea7c53a030d5d33f853e14fffd3f55af18.tar.zst
mailman-4164a2ea7c53a030d5d33f853e14fffd3f55af18.zip
Diffstat (limited to 'Mailman/Queue/CommandRunner.py')
-rw-r--r--Mailman/Queue/CommandRunner.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/Mailman/Queue/CommandRunner.py b/Mailman/Queue/CommandRunner.py
index c0f186140..cfde2f245 100644
--- a/Mailman/Queue/CommandRunner.py
+++ b/Mailman/Queue/CommandRunner.py
@@ -118,7 +118,7 @@ class Results:
return self.lineno <> 0
return handler.process(self, args)
- def make_response(self):
+ def send_response(self):
def indent(lines):
return [' ' + line for line in lines]
@@ -142,15 +142,26 @@ Attached is your original message.
results = MIMEText(
NL.join(resp),
_charset=Utils.GetCharSet(self.mlist.preferred_language))
+ # Safety valve for mail loops with misconfigured email 'bots. We
+ # don't respond to commands sent with "Precedence: bulk|junk|list"
+ # unless they explicitly "X-Ack: yes", but not all mail 'bots are
+ # correctly configured, so we max out the number of responses we'll
+ # give to an address in a single day.
+ #
+ # BAW: We wait until now to make this decision since our sender may
+ # not be self.msg.get_sender(), but I'm not sure this is right.
+ recip = self.returnaddr or self.msg.get_sender()
+ if not self.mlist.autorespondToSender(recip):
+ return
msg = Message.UserNotification(
- self.returnaddr or self.msg.get_sender(),
+ recip,
self.mlist.GetBouncesEmail(),
_('The results of your email commands'))
msg.set_type('multipart/mixed')
msg.attach(results)
orig = MIMEMessage(self.msg)
msg.attach(orig)
- return msg
+ msg.send(self.mlist)
@@ -193,8 +204,7 @@ class CommandRunner(Runner):
mo = re.match(mm_cfg.VERP_CONFIRM_REGEXP, msg.get('to', ''))
if mo:
res.do_command('confirm', (mo.group('cookie'),))
- msg = res.make_response()
- msg.send(mlist)
+ res.send_response()
mlist.Save()
finally:
mlist.Unlock()