[Pkg-mailman-hackers] Bug#578986: postfix-to-mailman.py bug

bryan d. o'connor bryan.oconnor at gmail.com
Sat Apr 24 02:44:04 UTC 2010


Package: mailman
Summary:  postfix+mailman+postfix-to-mailman.py breaks when
recipient_delimeter="-".

This bug was reported to Ubuntu as
https://bugs.launchpad.net/ubuntu/+source/mailman/+bug/529349

    a. Install postfix, mailman packages

         mail to user+xxx at example.com <user%2Bxxx at example.com> should be
delivered to user at example.com
         (because default postfix recipient_delimiter="+")

    b. Configure mailman according to instructions in
/usr/lib/mailman/bin/postfix-to-mailman.py
         i used a subdomain -- lists.example.com
         create a test list using a newlist.

         mail to test at list.example.com should be delivered to your list.
         mail to test-admin at list.example.com should be delivered to the list
admin.

    c. change postfix recipient_delimiter to "-".
         (add recipient_delimiter="-" to /etc/postfix/main.cf)
         restart postfix

         mail to user-xxx at example.com should be delivered to
user at example.com

         mail to test-admin at example.com will be erroneously sent to the test
list. postfix sees the recipient delimiter and strips it off before passing
it to the postfix-to-mailman.py script.

    d. apply attached patch.

         postfix will now pass the pre-processed email address (no
recipient_delimiter stripping) to postfix-to-mailman.py.

         mail to test-admin at list.example.com will now correctly go to the
list admin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-mailman-hackers/attachments/20100423/d473f5d0/attachment.htm>
-------------- next part --------------
diff --git a/mailman/postfix-to-mailman.py b/mailman/postfix-to-mailman.py
index 7e1aced..f29b672 100755
--- a/mailman/postfix-to-mailman.py
+++ b/mailman/postfix-to-mailman.py
@@ -100,7 +100,8 @@ def main():
         MailmanOwner = 'postmaster at localhost'
 
     try:
-        domain, local = [ a.lower() for a in sys.argv[1:] ]
+        domain, full = [ a.lower() for a in sys.argv[1:] ]
+        local = full.split("@")[0]
     except:
         # This might happen if we're not using Postfix or
         # /etc/postfix/master.cf is badly misconfigured
diff --git a/postfix/master.cf b/postfix/master.cf
index 28947fd..f606f49 100644
--- a/postfix/master.cf
+++ b/postfix/master.cf
@@ -79,5 +79,5 @@ scalemail-backend unix	-	n	n	-	2	pipe
   flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
 mailman   unix  -       n       n       -       -       pipe
   flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
-  ${nexthop} ${user}
+  ${nexthop} ${recipient}
 


More information about the Pkg-mailman-hackers mailing list