summaryrefslogtreecommitdiff
path: root/scripts/owner
blob: 3d1556e81dee6033859626d47bc32857ba8c64da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /usr/local/bin/python 

"""Send a message to the maillist owner.

This script gets called by the wrapper.

Stdin is the mail message, and argv[1] is the name of the mailing list
whose owner(s) to send mail to."""

__version__ = "$Revision: 399 $"


import sys
f = open('/tmp/owner.errs', 'a+')
sys.stderr = f

sys.path.append('/home/mailman/mailman/modules')

import maillist, mm_message

# Only let one program run at once per list.

# TODO: This *can* fail, and should send back an error message when it does.
current_list = maillist.MailList(sys.argv[1])
try:
    msg = mm_message.IncomingMessage()
    if not current_list.bounce_processing or not current_list.ScanMessage(msg):
	current_list.DeliverToList(msg, current_list.owner, '', '')
# Let another process run.
finally:
    current_list.Unlock()