diff options
Diffstat (limited to 'scripts/request')
| -rwxr-xr-x | scripts/request | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/request b/scripts/request index c3be1821d..70ee8c7f4 100755 --- a/scripts/request +++ b/scripts/request @@ -22,28 +22,33 @@ 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/error. """ import sys +import logging import paths from Mailman import Utils from Mailman import mm_cfg +from Mailman import loginit from Mailman.Queue.sbcache import get_switchboard from Mailman.i18n import _ def main(): + # Setup logging to stderr stream and error log. + loginit.initialize(propagate=True) + log = logging.getLogger('mailman.error') try: listname = sys.argv[1] except IndexError: - print >> sys.stderr, _('mailcmd script got no listname.') + log.error(_('mailcmd script got no listname.')) sys.exit(1) # Make sure the list exists if not Utils.list_exists(listname): - print >> sys.stderr, _('mailcmd script, list not found: %(listname)s') + log.error(_('mailcmd script, list not found: %(listname)s')) sys.exit(1) # Immediately queue the message for the bounce/cmd qrunner to process. # The advantage to this approach is that messages should never get lost -- |
