summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cron/disabled2
-rw-r--r--scripts/bounces11
-rwxr-xr-xscripts/confirm15
-rwxr-xr-xscripts/join11
-rwxr-xr-xscripts/leave11
-rwxr-xr-xscripts/owner12
-rwxr-xr-xscripts/post11
-rwxr-xr-xscripts/request11
8 files changed, 61 insertions, 23 deletions
diff --git a/cron/disabled b/cron/disabled
index dfc88cdf5..314339f1a 100644
--- a/cron/disabled
+++ b/cron/disabled
@@ -87,7 +87,7 @@ signal.signal(signal.SIGCHLD, signal.SIG_DFL)
PROGRAM = sys.argv[0]
-loginit.initialize(properly=True)
+loginit.initialize(propagate=True)
elog = logging.getLogger('mailman.error')
blog = logging.getLogger('mailman.bounce')
diff --git a/scripts/bounces b/scripts/bounces
index 7a8d6223c..6fa0f56b9 100644
--- a/scripts/bounces
+++ b/scripts/bounces
@@ -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, _('bounces script got no listname.')
+ log.error(_('bounces script got no listname.'))
sys.exit(1)
# Make sure the list exists
if not Utils.list_exists(listname):
- print >> sys.stderr, _('bounces script, list not found: %(listname)s')
+ log.error(_('bounces script, list not found: %(listname)s'))
sys.exit(1)
# Immediately queue the message for the bounces qrunner to process. The
# advantage to this approach is that messages should never get lost --
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 --
diff --git a/scripts/join b/scripts/join
index 3faab10ee..b378cc316 100755
--- a/scripts/join
+++ b/scripts/join
@@ -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, _('join script got no listname.')
+ log.error(_('join script got no listname.'))
sys.exit(1)
# Make sure the list exists
if not Utils.list_exists(listname):
- print >> sys.stderr, _('join script, list not found: %(listname)s')
+ log.error(_('join 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 --
diff --git a/scripts/leave b/scripts/leave
index c80972d60..627c440df 100755
--- a/scripts/leave
+++ b/scripts/leave
@@ -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, _('leave script got no listname.')
+ log.error(_('leave script got no listname.'))
sys.exit(1)
# Make sure the list exists
if not Utils.list_exists(listname):
- print >> sys.stderr, _('leave script, list not found: %(listname)s')
+ log.error(_('leave 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 --
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
diff --git a/scripts/post b/scripts/post
index 1142f3abf..0f5b268ec 100755
--- a/scripts/post
+++ b/scripts/post
@@ -24,19 +24,26 @@ through the mail wrapper. E.g. for list `test@yourdomain.com', the `test'
alias would deliver to this script.
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')
# XXX If you've configured your list or aliases so poorly as to get either
# of these first two errors, there's little that can be done to save your
# messages. They will be lost. Minimal testing of new lists should avoid
@@ -44,11 +51,11 @@ def main():
try:
listname = sys.argv[1]
except IndexError:
- print >> sys.stderr, _('post script got no listname.')
+ log.error(_('post script got no listname.'))
sys.exit(1)
# Make sure the list exists
if not Utils.list_exists(listname):
- print >> sys.stderr, _('post script, list not found: %(listname)s')
+ log.error(_('post script, list not found: %(listname)s'))
sys.exit(1)
# Immediately queue the message for the incoming qrunner to process. The
# advantage to this approach is that messages should never get lost --
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 --