diff options
| author | bwarsaw | 1999-12-16 17:12:31 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-12-16 17:12:31 +0000 |
| commit | eb3ab8a8a6db0ffc8cddd07a89d5b603817864f5 (patch) | |
| tree | 49d5190aff4d6aaf5bcbc19785e17be3dbe0ad34 /scripts | |
| parent | b13e11983eff0361b21a864eb25560586f0323c2 (diff) | |
| download | mailman-eb3ab8a8a6db0ffc8cddd07a89d5b603817864f5.tar.gz mailman-eb3ab8a8a6db0ffc8cddd07a89d5b603817864f5.tar.zst mailman-eb3ab8a8a6db0ffc8cddd07a89d5b603817864f5.zip | |
Port to the new way of handling messages. Also we don't send email
when the alias is misconfigured. This will just naturally happen in
the error logs.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/mailcmd | 36 | ||||
| -rwxr-xr-x | scripts/request | 36 |
2 files changed, 36 insertions, 36 deletions
diff --git a/scripts/mailcmd b/scripts/mailcmd index 34e77e300..6a8267677 100755 --- a/scripts/mailcmd +++ b/scripts/mailcmd @@ -26,30 +26,30 @@ Errors are redirected to logs/errors. import sys + import paths +from Mailman import mm_cfg from Mailman import MailList from Mailman import Utils - +from Mailman import Message +from Mailman.pythonlib.StringIO import StringIO from Mailman.Logging.Utils import LogStdErr -LogStdErr("error", "mailcmd") -# Only let one program run at once per list. +LogStdErr("error", "mailcmd") -if sys.argv[1] not in Utils.list_names(): - from Mailman import mm_cfg - Utils.SendTextToUser("Misconfigured list %s" % sys.argv[1], - ("List %s in aliases but not among " - "list_names?\n\n" - "---------- Forwarded message ----------\n" - "%s" - % (mm_cfg.MAILMAN_OWNER, sys.stdin.read())), - mm_cfg.MAILMAN_OWNER, - sender=mm_cfg.MAILMAN_OWNER) -list = MailList.MailList(sys.argv[1]) + +def main(): + # allow misconfigurations to be logged in logs/error + mlist = MailList.MailList(sys.argv[1]) + try: + s = StringIO(sys.stdin.read()) + msg = Message.Message(s) + mlist.ParseMailCommands(msg) + finally: + mlist.Save() + mlist.Unlock() -try: - list.ParseMailCommands() -finally: - list.Unlock() +if __name__ == '__main__': + main() diff --git a/scripts/request b/scripts/request index 34e77e300..6a8267677 100755 --- a/scripts/request +++ b/scripts/request @@ -26,30 +26,30 @@ Errors are redirected to logs/errors. import sys + import paths +from Mailman import mm_cfg from Mailman import MailList from Mailman import Utils - +from Mailman import Message +from Mailman.pythonlib.StringIO import StringIO from Mailman.Logging.Utils import LogStdErr -LogStdErr("error", "mailcmd") -# Only let one program run at once per list. +LogStdErr("error", "mailcmd") -if sys.argv[1] not in Utils.list_names(): - from Mailman import mm_cfg - Utils.SendTextToUser("Misconfigured list %s" % sys.argv[1], - ("List %s in aliases but not among " - "list_names?\n\n" - "---------- Forwarded message ----------\n" - "%s" - % (mm_cfg.MAILMAN_OWNER, sys.stdin.read())), - mm_cfg.MAILMAN_OWNER, - sender=mm_cfg.MAILMAN_OWNER) -list = MailList.MailList(sys.argv[1]) + +def main(): + # allow misconfigurations to be logged in logs/error + mlist = MailList.MailList(sys.argv[1]) + try: + s = StringIO(sys.stdin.read()) + msg = Message.Message(s) + mlist.ParseMailCommands(msg) + finally: + mlist.Save() + mlist.Unlock() -try: - list.ParseMailCommands() -finally: - list.Unlock() +if __name__ == '__main__': + main() |
