diff options
| author | klm | 1998-04-23 20:03:16 +0000 |
|---|---|---|
| committer | klm | 1998-04-23 20:03:16 +0000 |
| commit | a425c1ac771c4852b4bd1ebbb02436a98688cc2c (patch) | |
| tree | 5ea319242b9e3b586be4c987816a774e30c96b2f | |
| parent | 5d4d03ce0c09d6a28f904778c46bb6924e76465c (diff) | |
| download | mailman-a425c1ac771c4852b4bd1ebbb02436a98688cc2c.tar.gz mailman-a425c1ac771c4852b4bd1ebbb02436a98688cc2c.tar.zst mailman-a425c1ac771c4852b4bd1ebbb02436a98688cc2c.zip | |
Ignore any mailcommands coming from postmaster-type accounts -
mailer-daemon, postmaster, orphanage, and postoffice - on the
presumption that they're failed subscribe instructions, bouncing back
to the -request addr.
I think this'll take care of that sticky problem fairly safely.
Nobody should be sending commands from those accounts, anyway...
| -rw-r--r-- | Mailman/MailCommandHandler.py | 8 | ||||
| -rw-r--r-- | modules/mm_mailcmd.py | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/Mailman/MailCommandHandler.py b/Mailman/MailCommandHandler.py index 45383733f..8906773e6 100644 --- a/Mailman/MailCommandHandler.py +++ b/Mailman/MailCommandHandler.py @@ -1,6 +1,6 @@ """Process maillist user commands arriving via email.""" -__version__ = "$Revision: 398 $" +__version__ = "$Revision: 468 $" # Try to stay close to majordomo commands, but accept common mistakes. # Not implemented: get / index / which. @@ -58,6 +58,12 @@ class MailCommandHandler: def ParseMailCommands(self): 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`) + return if subject: subject = string.strip(subject) if (subject and self._cmd_dispatch.has_key(string.split(subject)[0])): diff --git a/modules/mm_mailcmd.py b/modules/mm_mailcmd.py index 45383733f..8906773e6 100644 --- a/modules/mm_mailcmd.py +++ b/modules/mm_mailcmd.py @@ -1,6 +1,6 @@ """Process maillist user commands arriving via email.""" -__version__ = "$Revision: 398 $" +__version__ = "$Revision: 468 $" # Try to stay close to majordomo commands, but accept common mistakes. # Not implemented: get / index / which. @@ -58,6 +58,12 @@ class MailCommandHandler: def ParseMailCommands(self): 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`) + return if subject: subject = string.strip(subject) if (subject and self._cmd_dispatch.has_key(string.split(subject)[0])): |
