summaryrefslogtreecommitdiff
path: root/Mailman/MailCommandHandler.py
diff options
context:
space:
mode:
authorklm1998-04-27 15:08:46 +0000
committerklm1998-04-27 15:08:46 +0000
commit96522ba0821c12d09fa3bd96d0a75223925bd707 (patch)
tree958cf725dafd7764c071e0aed7a457ba548100b8 /Mailman/MailCommandHandler.py
parente1e7b64869b1ce86480652cd2b35d71e8d264063 (diff)
downloadmailman-96522ba0821c12d09fa3bd96d0a75223925bd707.tar.gz
mailman-96522ba0821c12d09fa3bd96d0a75223925bd707.tar.zst
mailman-96522ba0821c12d09fa3bd96d0a75223925bd707.zip
Discard "mail commands" from postmaster accounts (nobody,
mailer-daemon, postmaster, orphanage, postoffic) - they're almost certainly delivery-failure notices. I'm going to poll the mailman-developers list for suggestions about refinements to this approach.
Diffstat (limited to 'Mailman/MailCommandHandler.py')
-rw-r--r--Mailman/MailCommandHandler.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/Mailman/MailCommandHandler.py b/Mailman/MailCommandHandler.py
index 8906773e6..999a94808 100644
--- a/Mailman/MailCommandHandler.py
+++ b/Mailman/MailCommandHandler.py
@@ -1,6 +1,6 @@
"""Process maillist user commands arriving via email."""
-__version__ = "$Revision: 468 $"
+__version__ = "$Revision: 473 $"
# Try to stay close to majordomo commands, but accept common mistakes.
# Not implemented: get / index / which.
@@ -59,10 +59,20 @@ class MailCommandHandler:
mail = mm_message.IncomingMessage()
subject = mail.getheader("subject")
sender = string.lower(mail.GetSender())
- if sender in ['mailer-daemon', 'postmaster', 'orphanage',
- 'postoffice']:
- self.LogMsg("bounce", "%s: Mailcmd from %s rejected, subj %s",
- self._internal_name, sender, `subject`)
+ if sender in ['nobody', 'mailer-daemon', 'postmaster',
+ 'orphanage', 'postoffice']:
+ # This is for what are probably delivery-failure notices of
+ # subscription confirmations that are, of necessity, bounced
+ # back to the -request address.
+ self.LogMsg("bounce",
+ ("%s: Mailcmd rejected"
+ "\n\tReason: Probable bounced subscribe-confirmation"
+ "\n\tFrom: %s"
+ "\n\tSubject: %s"
+ ),
+ self._internal_name,
+ mail.getheader('from'),
+ subject)
return
if subject:
subject = string.strip(subject)