diff options
author | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2019-06-21 07:51:01 +0900 |
---|---|---|
committer | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2019-06-21 07:51:01 +0900 |
commit | 3d32d14b3929489226106ee935bcbb6242b71866 (patch) | |
tree | 91507de6cf467ed68f63e6d1aa6c29c317ca662f /Mailman/MTA/Postfix.py | |
parent | 83402ad71a22c272ea825068e496efc7fdcebb86 (diff) | |
parent | a5de21c5b47e37b65f66975e7a8ca82be2bc3de4 (diff) | |
download | mailman2-3d32d14b3929489226106ee935bcbb6242b71866.tar.gz mailman2-3d32d14b3929489226106ee935bcbb6242b71866.tar.xz mailman2-3d32d14b3929489226106ee935bcbb6242b71866.zip |
merge lp:mailman/2.1 up to rev 1817
Diffstat (limited to 'Mailman/MTA/Postfix.py')
-rw-r--r-- | Mailman/MTA/Postfix.py | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/Mailman/MTA/Postfix.py b/Mailman/MTA/Postfix.py index 798957a5..e15e798f 100644 --- a/Mailman/MTA/Postfix.py +++ b/Mailman/MTA/Postfix.py @@ -159,13 +159,19 @@ def _addvirtual(mlist, fp): # 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. + # And the site list -owner, -bounces and -request addresses. siteowneraddr = Utils.get_site_email(mlist.host_name, extra='owner') siteownerdest = Utils.ParseEmail(siteowneraddr)[0] + sitebouncesaddr = Utils.get_site_email(mlist.host_name, extra='bounces') + sitebouncesdest = Utils.ParseEmail(sitebouncesaddr)[0] + siterequestaddr = Utils.get_site_email(mlist.host_name, extra='request') + siterequestdest = Utils.ParseEmail(siterequestaddr)[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 + sitebouncesdest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN + siterequestdest += '@' + 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 @@ -174,6 +180,8 @@ def _addvirtual(mlist, fp): hostname.lower()): siteaddr = '#' + siteaddr siteowneraddr = '#' + siteowneraddr + sitebouncesaddr = '#' + sitebouncesaddr + siterequestaddr = '#' + siterequestaddr # 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) @@ -192,14 +200,18 @@ def _addvirtual(mlist, fp): # LOOP ADDRESSES END # We also add the site list address in each virtual domain as that address -# 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. +# is exposed on admin and listinfo overviews, and we add the site list-owner, +# -bounces and -request addresses as they are exposed in the list created +# and/or password reminder email notices. # SITE ADDRESSES START %s\t%s %s\t%s +%s\t%s +%s\t%s # SITE ADDRESSES END -""" % (loopaddr, loopdest, siteaddr, sitedest, siteowneraddr, siteownerdest) +""" % (loopaddr, loopdest, siteaddr, sitedest, siteowneraddr, siteownerdest, + sitebouncesaddr, sitebouncesdest, siterequestaddr, siterequestdest) # The text file entries get a little extra info print >> fp, '# STANZA START:', listname print >> fp, '# CREATED:', time.ctime(time.time()) @@ -226,10 +238,16 @@ def _check_for_virtual_loopaddr(mlist, filename): sitedest = Utils.ParseEmail(siteaddr)[0] siteowneraddr = Utils.get_site_email(mlist.host_name, extra='owner') siteownerdest = Utils.ParseEmail(siteowneraddr)[0] + sitebouncesaddr = Utils.get_site_email(mlist.host_name, extra='bounces') + sitebouncesdest = Utils.ParseEmail(sitebouncesaddr)[0] + siterequestaddr = Utils.get_site_email(mlist.host_name, extra='request') + siterequestdest = Utils.ParseEmail(siterequestaddr)[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 + sitebouncesdest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN + siterequestdest += '@' + 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 @@ -238,6 +256,8 @@ def _check_for_virtual_loopaddr(mlist, filename): mlist.host_name.lower()): siteaddr = '#' + siteaddr siteowneraddr = '#' + siteowneraddr + sitebouncesaddr = '#' + sitebouncesaddr + siterequestaddr = '#' + siterequestaddr infp = open(filename) omask = os.umask(007) try: @@ -288,6 +308,8 @@ def _check_for_virtual_loopaddr(mlist, filename): # It hasn't print >> outfp, '%s\t%s' % (siteaddr, sitedest) print >> outfp, '%s\t%s' % (siteowneraddr, siteownerdest) + print >> outfp, '%s\t%s' % (sitebouncesaddr, sitebouncesdest) + print >> outfp, '%s\t%s' % (siterequestaddr, siterequestdest) outfp.write(line) break elif line.startswith(siteaddr) or line.startswith('#' + siteaddr): |