From 1f84aaac8e30c46cf78e46ce9707b8cc33d4f311 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 20 Nov 2001 17:26:50 +0000 Subject: Because the CommandRunner no longer processes -owner messages, we need to do a little more work here. Specifically, we need to add an explicit pipeline to the message's metadata, then we can send the message through the normal incoming queue (i.e. we override the incoming queue's default pipeline). We also set the envsender attribute to point to the -bounces address for the list so we can handle any bounces to the list's owners. --- scripts/mailowner | 37 ++++++++++++++++++++----------------- scripts/owner | 37 ++++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/scripts/mailowner b/scripts/mailowner index be95261b0..d018d0c71 100755 --- a/scripts/mailowner +++ b/scripts/mailowner @@ -18,12 +18,11 @@ """Send a message to the mailing list owner. -The -owner address for alist should be filtered to this program, through the -mail wrapper. E.g. for list `test@yourdomain.com', the `test-owner' alias -would deliver to this script. +All messages to a list's -owner address should be piped through this script. +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. - """ import sys @@ -37,6 +36,13 @@ from Mailman.Logging.Utils import LogStdErr LogStdErr('error', 'mailowner') +OWNER_PIPELINE = [ + 'SpamDetect', + 'Replybot', + 'OwnerRecips', + 'ToOutgoing', + ] + def main(): @@ -50,19 +56,16 @@ def main(): print >> sys.stderr, _( 'mailowner 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 -- - # some MTAs have a hard limit to the time a filter prog can run. Postfix - # is a good example; if the limit is hit, the proc is SIGKILL'd giving us - # no chance to save the message. - # - # BAW: This script can receive both -owner and -admin messages. This is - # bogus because there /is/ a distinction: -admin messages do bounce - # processing while -owner messages do not. However, it's too expensive to - # make this determination here, so we defer it to the CommandRunner. - cmdq = get_switchboard(mm_cfg.CMDQUEUE_DIR) - cmdq.enqueue(sys.stdin.read(), listname=listname, toauthoritah=1, - _plaintext=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 + # processing is minimal though, so craft our own pipeline, expressly for + # the purpose of delivering to the list owners. + inq = get_switchboard(mm_cfg.INQUEUE_DIR) + inq.enqueue(sys.stdin.read(), + listname=listname, + _plaintext=1, + envsender=Utils.get_site_email(extra='bounces'), + pipeline=OWNER_PIPELINE) diff --git a/scripts/owner b/scripts/owner index be95261b0..d018d0c71 100755 --- a/scripts/owner +++ b/scripts/owner @@ -18,12 +18,11 @@ """Send a message to the mailing list owner. -The -owner address for alist should be filtered to this program, through the -mail wrapper. E.g. for list `test@yourdomain.com', the `test-owner' alias -would deliver to this script. +All messages to a list's -owner address should be piped through this script. +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. - """ import sys @@ -37,6 +36,13 @@ from Mailman.Logging.Utils import LogStdErr LogStdErr('error', 'mailowner') +OWNER_PIPELINE = [ + 'SpamDetect', + 'Replybot', + 'OwnerRecips', + 'ToOutgoing', + ] + def main(): @@ -50,19 +56,16 @@ def main(): print >> sys.stderr, _( 'mailowner 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 -- - # some MTAs have a hard limit to the time a filter prog can run. Postfix - # is a good example; if the limit is hit, the proc is SIGKILL'd giving us - # no chance to save the message. - # - # BAW: This script can receive both -owner and -admin messages. This is - # bogus because there /is/ a distinction: -admin messages do bounce - # processing while -owner messages do not. However, it's too expensive to - # make this determination here, so we defer it to the CommandRunner. - cmdq = get_switchboard(mm_cfg.CMDQUEUE_DIR) - cmdq.enqueue(sys.stdin.read(), listname=listname, toauthoritah=1, - _plaintext=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 + # processing is minimal though, so craft our own pipeline, expressly for + # the purpose of delivering to the list owners. + inq = get_switchboard(mm_cfg.INQUEUE_DIR) + inq.enqueue(sys.stdin.read(), + listname=listname, + _plaintext=1, + envsender=Utils.get_site_email(extra='bounces'), + pipeline=OWNER_PIPELINE) -- cgit v1.2.3-70-g09d2