diff options
| author | bwarsaw | 1998-06-19 19:46:57 +0000 |
|---|---|---|
| committer | bwarsaw | 1998-06-19 19:46:57 +0000 |
| commit | 8d1ec3ae14fcc935284c2fff960265d234ed54e2 (patch) | |
| tree | 67e69a8c365dec4d0ca5c2042795eb298a449f2f /scripts | |
| parent | 2ceaa1195001558d1ed1f8718fe329ad437978f3 (diff) | |
| download | mailman-8d1ec3ae14fcc935284c2fff960265d234ed54e2.tar.gz mailman-8d1ec3ae14fcc935284c2fff960265d234ed54e2.tar.zst mailman-8d1ec3ae14fcc935284c2fff960265d234ed54e2.zip | |
Packagized
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/answer_majordomo_mail | 15 | ||||
| -rwxr-xr-x | scripts/mailcmd | 30 | ||||
| -rwxr-xr-x | scripts/mailowner | 15 | ||||
| -rwxr-xr-x | scripts/owner | 15 | ||||
| -rwxr-xr-x | scripts/post | 22 | ||||
| -rwxr-xr-x | scripts/request | 30 |
6 files changed, 71 insertions, 56 deletions
diff --git a/scripts/answer_majordomo_mail b/scripts/answer_majordomo_mail index 661de57fb..4ef5fdbc6 100755 --- a/scripts/answer_majordomo_mail +++ b/scripts/answer_majordomo_mail @@ -22,17 +22,18 @@ import sys import os import paths -import mm_message, mm_utils +from Mailman import Message +from Mailman import Utils try: - sys.stderr = mm_utils.StampedLogger("error", - label = 'answer_majordomo_mail', - manual_reprime=1) + sys.stderr = Utils.StampedLogger("error", + label = 'answer_majordomo_mail', + manual_reprime=1) except IOError: pass # Oh well - SOL on redirect, errors show thru. -msg = mm_message.IncomingMessage() +msg = Message.IncomingMessage() txtfile = os.path.join(paths.prefix, 'misc/majordomo.answer.txt') text = open(txtfile, 'r').read() -mm_utils.SendTextToUser('Your mail to Majordomo...', text, msg.GetSender(), - 'mailman-owner') +Utils.SendTextToUser('Your mail to Majordomo...', text, msg.GetSender(), + 'mailman-owner') diff --git a/scripts/mailcmd b/scripts/mailcmd index fa94dfeb5..4e9c6139f 100755 --- a/scripts/mailcmd +++ b/scripts/mailcmd @@ -21,34 +21,36 @@ Called by the wrapper, stdin is the mail message, and argv[1] is the name of the target mailing list. -Errors are redirected to logs/errors.""" +Errors are redirected to logs/errors. +""" import sys import paths -import maillist, mm_utils +from Mailman import MailList +from Mailman import Utils try: - sys.stderr = mm_utils.StampedLogger("error", label = 'mailcmd', - manual_reprime=1) + sys.stderr = Utils.StampedLogger("error", label = 'mailcmd', + manual_reprime=1) except IOError: pass # Oh well - SOL on redirect, errors show thru. # Only let one program run at once per list. -if sys.argv[1] not in mm_utils.list_names(): +if sys.argv[1] not in Utils.list_names(): import mm_cfg - mm_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) + 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]) +list = MailList.MailList(sys.argv[1]) try: list.ParseMailCommands() diff --git a/scripts/mailowner b/scripts/mailowner index 51b724e35..ab6c760d1 100755 --- a/scripts/mailowner +++ b/scripts/mailowner @@ -21,25 +21,28 @@ This script gets called by the wrapper. Stdin is the mail message, and argv[1] is the name of the mailing list -whose owner(s) to send mail to.""" +whose owner(s) to send mail to. +""" import sys import paths -import maillist, mm_message, mm_utils +from Mailman import MailList +from Mailman import Message +from Mailman import Utils try: - sys.stderr = mm_utils.StampedLogger("error", label = 'post', - manual_reprime=1, nofail=0) + sys.stderr = Utils.StampedLogger("error", label = 'post', + manual_reprime=1, nofail=0) except IOError: pass # Oh well - SOL on redirect, errors show thru. # Only let one program run at once per list. # TODO: This *can* fail, and should send back an error message when it does. -current_list = maillist.MailList(sys.argv[1]) +current_list = MailList.MailList(sys.argv[1]) try: - msg = mm_message.IncomingMessage() + msg = Message.IncomingMessage() if not current_list.bounce_processing or not current_list.ScanMessage(msg): current_list.DeliverToList(msg, current_list.owner, '', '') # Let another process run. diff --git a/scripts/owner b/scripts/owner index 51b724e35..ab6c760d1 100755 --- a/scripts/owner +++ b/scripts/owner @@ -21,25 +21,28 @@ This script gets called by the wrapper. Stdin is the mail message, and argv[1] is the name of the mailing list -whose owner(s) to send mail to.""" +whose owner(s) to send mail to. +""" import sys import paths -import maillist, mm_message, mm_utils +from Mailman import MailList +from Mailman import Message +from Mailman import Utils try: - sys.stderr = mm_utils.StampedLogger("error", label = 'post', - manual_reprime=1, nofail=0) + sys.stderr = Utils.StampedLogger("error", label = 'post', + manual_reprime=1, nofail=0) except IOError: pass # Oh well - SOL on redirect, errors show thru. # Only let one program run at once per list. # TODO: This *can* fail, and should send back an error message when it does. -current_list = maillist.MailList(sys.argv[1]) +current_list = MailList.MailList(sys.argv[1]) try: - msg = mm_message.IncomingMessage() + msg = Message.IncomingMessage() if not current_list.bounce_processing or not current_list.ScanMessage(msg): current_list.DeliverToList(msg, current_list.owner, '', '') # Let another process run. diff --git a/scripts/post b/scripts/post index 24184664b..2566ba790 100755 --- a/scripts/post +++ b/scripts/post @@ -31,10 +31,14 @@ thus should not be re-posted to news if the list gates to a newsgroup. import sys import paths -import maillist, mm_message, mm_err, mm_cfg, mm_utils +from Mailman import MailList +from Mailman import Message +from Mailman import Errors +from Mailman import Utils + try: - sys.stderr = mm_utils.StampedLogger("error", label = 'post', + sys.stderr = Utils.StampedLogger("error", label = 'post', manual_reprime=1, nofail=0) except IOError: pass # Oh well - SOL on redirect, errors show thru. @@ -42,7 +46,7 @@ except IOError: # Only let one program run at once per list. # TODO: This can fail, and should send back an error message when it does. -current_list = maillist.MailList(sys.argv[1]) +current_list = MailList.MailList(sys.argv[1]) if len(sys.argv) > 2: current_list.tmp_prevent_gate = 1 else: @@ -59,16 +63,16 @@ try: text = sys.stdin.read() else: text = sys.stdin.read() - msg = mm_message.IncomingMessage(text) + msg = Message.IncomingMessage(text) try: current_list.Post(msg) - except mm_err.MMNeedApproval, err_msg: + except Errors.MMNeedApproval, err_msg: if (current_list.dont_respond_to_post_requests - or err_msg == mm_err.MODERATED_LIST_MSG - or err_msg == mm_err.IMPLICIT_DEST_MSG - or err_msg == mm_err.SUSPICIOUS_HEADER_MSG - or err_msg == mm_err.FORBIDDEN_SENDER_MSG): + or err_msg == Errors.MODERATED_LIST_MSG + or err_msg == Errors.IMPLICIT_DEST_MSG + or err_msg == Errors.SUSPICIOUS_HEADER_MSG + or err_msg == Errors.FORBIDDEN_SENDER_MSG): # Do not send hold-for-approval notices for moderated messages # or potential spam. current_list.Unlock() diff --git a/scripts/request b/scripts/request index fa94dfeb5..4e9c6139f 100755 --- a/scripts/request +++ b/scripts/request @@ -21,34 +21,36 @@ Called by the wrapper, stdin is the mail message, and argv[1] is the name of the target mailing list. -Errors are redirected to logs/errors.""" +Errors are redirected to logs/errors. +""" import sys import paths -import maillist, mm_utils +from Mailman import MailList +from Mailman import Utils try: - sys.stderr = mm_utils.StampedLogger("error", label = 'mailcmd', - manual_reprime=1) + sys.stderr = Utils.StampedLogger("error", label = 'mailcmd', + manual_reprime=1) except IOError: pass # Oh well - SOL on redirect, errors show thru. # Only let one program run at once per list. -if sys.argv[1] not in mm_utils.list_names(): +if sys.argv[1] not in Utils.list_names(): import mm_cfg - mm_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) + 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]) +list = MailList.MailList(sys.argv[1]) try: list.ParseMailCommands() |
