punit_j wrote:
>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: &nbs
p
> ; # 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): &n
b
> 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
The first thing you are doing wrong is posting unreadable messages to
this list.
Please, if you want our help, find a way to post a readable plain text
message. You are using an MUA that is composing an HTML message and
then doing a horrible job of "converting" the HTML to plain text for
the text/plain alternative of a multipart/alternative message. This
list's content filtering then removes all but the text/plain part
which has no line breaks and is littered with
We would like to help if we can, but we can't help if we can't read
your message.
Note, I do see the string "postfix-to-mailman.py" in the above.
postfix-to-mailman.py is not supported by the GNU Mailman project and
is generally not suitable in any case unless you have a dedicated
domain for your lists.
--
Mark Sapiro <[email protected]> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
------------------------------------------------------
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