summaryrefslogtreecommitdiff
path: root/scripts/mailcmd
blob: 19fe69d5c4fd2f6bdca0152d3fd23b919d18a6b2 (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
#! /usr/local/bin/python 
# 
# This script gets called by the wrapper.
# Stdin is the mail message, and argv[1] is the name of the mailing list
# being posted to.

import sys
f = open('/tmp/mailcmd.err', 'a+')
sys.stderr = f

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

import maillist

# Only let one program run at once per list.

# TODO: This can fail, and should send back an error message when it does.
list = maillist.MailList(sys.argv[1])

try:
    list.ParseMailCommands()
finally:
    list.Unlock()