------------------------------------------------------------
revno: 1706
fixes bug: https://launchpad.net/bugs/1694384
committer: Mark Sapiro <m...@msapiro.net>
branch nick: 2.1
timestamp: Tue 2017-05-30 15:06:15 -0700
message:
  Added list-owner@virtual.domain addresses to virtual-mailman.
modified:
  Mailman/MTA/Postfix.py
  NEWS


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/MTA/Postfix.py'
--- Mailman/MTA/Postfix.py	2016-05-12 18:54:42 +0000
+++ Mailman/MTA/Postfix.py	2017-05-30 22:06:15 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2016 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 by the Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -131,13 +131,21 @@
     # And the site list posting address.
     siteaddr = Utils.get_site_email(mlist.host_name)
     sitedest = Utils.ParseEmail(siteaddr)[0]
+    # And the site list -owner address.
+    siteowneraddr = Utils.get_site_email(mlist.host_name, extra='owner')
+    siteownerdest = Utils.ParseEmail(siteowneraddr)[0]
     if mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN:
         loopdest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN
         sitedest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN
-    # If the site list's host_name is a virtual domain, adding it to the
-    # SITE ADDRESSES will duplicate the list posting entry, so comment it.
-    if _isvirtual(MailList(mm_cfg.MAILMAN_SITE_LIST, lock=False)):
+        siteownerdest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN
+    # If the site list's host_name is a virtual domain, adding the list and
+    # owner addresses to the SITE ADDRESSES will duplicate the entries in the
+    # stanza for the list.  Postfix doesn't like dups so we try to comment them
+    # here, but only for the actual site list domain.
+    if (MailList(mm_cfg.MAILMAN_SITE_LIST, lock=False).host_name.lower() ==
+            hostname.lower()):
         siteaddr = '#' + siteaddr
+        siteowneraddr = '#' + siteowneraddr
     # Seek to the end of the text file, but if it's empty write the standard
     # disclaimer, and the loop catch address and site address.
     fp.seek(0, 2)
@@ -156,11 +164,14 @@
 # LOOP ADDRESSES END
 
 # We also add the site list address in each virtual domain as that address
-# is exposed on admin and listinfo overviews.
+# is exposed on admin and listinfo overviews, and we add the site list-owner
+# address as it is exposed in the list created email notice.
+
 # SITE ADDRESSES START
 %s\t%s
+%s\t%s
 # SITE ADDRESSES END
-""" % (loopaddr, loopdest, siteaddr, sitedest)
+""" % (loopaddr, loopdest, siteaddr, sitedest, siteowneraddr, siteownerdest)
     # The text file entries get a little extra info
     print >> fp, '# STANZA START:', listname
     print >> fp, '# CREATED:', time.ctime(time.time())
@@ -185,9 +196,20 @@
     loopdest = Utils.ParseEmail(loopaddr)[0]
     siteaddr = Utils.get_site_email(mlist.host_name)
     sitedest = Utils.ParseEmail(siteaddr)[0]
+    siteowneraddr = Utils.get_site_email(mlist.host_name, extra='owner')
+    siteownerdest = Utils.ParseEmail(siteowneraddr)[0]
     if mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN:
         loopdest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN
         sitedest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN
+        siteownerdest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN
+    # If the site list's host_name is a virtual domain, adding the list and
+    # owner addresses to the SITE ADDRESSES will duplicate the entries in the
+    # stanza for the list.  Postfix doesn't like dups so we try to comment them
+    # here, but only for the actual site list domain.
+    if (MailList(mm_cfg.MAILMAN_SITE_LIST, lock=False).host_name.lower() ==
+            mlist.host_name.lower()):
+        siteaddr = '#' + siteaddr
+        siteowneraddr = '#' + siteowneraddr
     infp = open(filename)
     omask = os.umask(007)
     try:
@@ -237,6 +259,7 @@
             if line.startswith('# SITE ADDRESSES END'):
                 # It hasn't
                 print >> outfp, '%s\t%s' % (siteaddr, sitedest)
+                print >> outfp, '%s\t%s' % (siteowneraddr, siteownerdest)
                 outfp.write(line)
                 break
             elif line.startswith(siteaddr) or line.startswith('#' + siteaddr):

=== modified file 'NEWS'
--- NEWS	2017-05-30 20:41:30 +0000
+++ NEWS	2017-05-30 22:06:15 +0000
@@ -44,6 +44,9 @@
 
   Bug fixes and other patches
 
+    - The list-owner@virtual.domain addresses are now added to virtual-mailman
+      as they are exposed in 'list created' emails.  (LP: 1694384)
+
     - The 'list run by' addresses in web page footers are now just the
       list-owner address.  (LP: #1694384)
 

_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to