diff options
Diffstat (limited to 'scripts/confirm')
| -rwxr-xr-x | scripts/confirm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/confirm b/scripts/confirm index 4443a41c5..b5a62dd46 100755 --- a/scripts/confirm +++ b/scripts/confirm @@ -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 mm_cfg from Mailman import Utils -from Mailman.i18n import _ +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, _('confirm script got no listname.') + log.error(_('confirm script got no listname.')) sys.exit(1) # Make sure the list exists if not Utils.list_exists(listname): - print >> sys.stderr, _('confirm script, list not found: %(listname)s') + log.error(_('confirm 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 -- |
