diff options
Diffstat (limited to 'scripts/owner')
| -rwxr-xr-x | scripts/owner | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/owner b/scripts/owner index 1cd480124..82921880e 100755 --- a/scripts/owner +++ b/scripts/owner @@ -24,28 +24,34 @@ The -owner address is defined to be delivered directly to the list owners plus the list moderators, with no intervention for bounce processing. Stdin is the mail message, and argv[1] is the name of the target mailing list. + +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, _('mailowner got no listname.') + log.error(_('mailowner script got no listname.')) sys.exit(1) # Make sure the list exists if not Utils.list_exists(listname): - print >> sys.stderr, _( - 'mailowner script, list not found: %(listname)s') + log.error(_('mailowner script, list not found: %(listname)s')) sys.exit(1) # Queue the message for the owners. We will send them through the # incoming queue because we need some processing done on the message. The |
