[Mailman-Users] mails bounce when sent to join address

punit_j punit_j at rediffmail.com
Fri Apr 17 18:09:42 CEST 2009

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 = "listadminuser at test.com"; # 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"),    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):            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 testing-join at test.com ( a subscription mail to testing list ) , it bounces with following error : -   The mail system<testing-join at test.com>: 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    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

More information about the Mailman-Users mailing list