Hi ,I am integrating mailman with postfix. I have created new transport by name
mailman :-mailman unix -
n n
- -
pipe flags=FR user=mailman:mailman
argv=/usr/local/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}Below is
the script : -MailmanHome = "/usr/local/mailman"; # Mailman home
directory.MailmanOwner = "[email protected]"; # Postmaster and abuse mail
recipient.import sys, os, re, stringdef main():
os.nice(5) # Handle mailing lists at non-interactive
priority. # delete this if you
wish os.chdir(MailmanHome + "/lists")
try: local =
sys.argv[2] except:  
; # This might happen if we're not using
Postfix sys.stderr.write("LOCAL not
set?\n")
sys.exit(1) local = string.lower(local)
local = re.sub("^mailman-","",local) names = ("root",
"postmaster", "mailer-daemon", "mailman-owner", "owner",
"abuse") for i in
names: if i ==
local:
os.execv("/usr/sbin/sendmail",
("/usr/sbin/sendmail",
MailmanOwner))
sys.exit(0) type = "post" types =
(("-admin$",
"admin"),
("-owner$", "owner"), &
nbsp; types = (("-admin$",
"admin"),
("-owner$",
"owner"),
("-request$",
"request"),
("-bounces$",
"bounces"),
("-confirm$",
"confirm"),
("-join$",
"join"),
("-leave$",
"leave"),
("-subscribe$",
"subscribe"),
("-unsubscribe$", "unsubscribe")) for i in
types: if
re.search(i[0],local): &nb
sp; type =
i[1] local =
re.sub(i[0],"",local) if
os.path.exists(local):
os.execv(MailmanHome +
"/mail/mailman",
(MailmanHome + "/mail/mailman", type, local))
else: bounce()
sys.exit(75)def bounce(): bounce_message = """\TO ACCESS THE
MAILING LIST SYSTEM: Start your web browser onhttp://%s/That web page will help
you subscribe or unsubscribe, and willgive you directions on how to post to
each mailing list.\n""" sys.stderr.write(bounce_message %
(sys.argv[1])) sys.exit(1)try:
sys.exit(main())except SystemExit, argument:
sys.exit(argument)except Exception, argument: info = sys.
exc_info() trace = info[2]
sys.stderr.write("%s %s\n" % (sys.exc_type, argument))
sys.stderr.write("Line %d\n" % (trace.tb_lineno))
sys.exit(75) # Soft failure, try again
later.But when i send mail to [email protected] ( a subscription mail to
testing list ) , it bounces with following error : - The mail
system<[email protected]>: Command died with status 2:
"/usr/local/mailman/bin/postfix-to-mailman.py". Command
output: /usr/local/mailman/bin/postfix-to-mailman.py: line 2:
MailmanHome: command not found
/usr/local/mailman/bin/postfix-to-mailman.py: line 3:
MailmanOwner: command not found
/usr/local/mailman/bin/postfix-to-mailman.py: line 61: import: command
not found /usr/local/mailman/bin/postfix-to-mailman.py: line
63: syntax error &n
bsp; near unexpected token `('
/usr/local/mailman/bin/postfix-to-mailman.py: line 63: `def
main():'I am no python expert. can anyone direct me to what i am doing wrong
?Regards,Punit
------------------------------------------------------
Mailman-Users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe:
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org
Security Policy: http://wiki.list.org/x/QIA9