diff options
author | Mark Sapiro <mark@msapiro.net> | 2016-04-14 16:25:57 -0700 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2016-04-14 16:25:57 -0700 |
commit | 5019dc01d25398b37596e86a7fa9c036576c4235 (patch) | |
tree | e5caf9f96a1df779bab21c175cdc3e6ded60a86a /Mailman | |
parent | 1ced1bf606d8545d15437765f23f8004d196739b (diff) | |
download | mailman2-5019dc01d25398b37596e86a7fa9c036576c4235.tar.gz mailman2-5019dc01d25398b37596e86a7fa9c036576c4235.tar.xz mailman2-5019dc01d25398b37596e86a7fa9c036576c4235.zip |
Fixed missing VIRTUAL_MAILMAN_LOCAL_DOMAIN and duplicates in virtual-mailman.
Diffstat (limited to 'Mailman')
-rw-r--r-- | Mailman/MTA/Postfix.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Mailman/MTA/Postfix.py b/Mailman/MTA/Postfix.py index 8860459e..d18d850b 100644 --- a/Mailman/MTA/Postfix.py +++ b/Mailman/MTA/Postfix.py @@ -28,6 +28,7 @@ from Mailman import mm_cfg from Mailman import Utils from Mailman import LockFile from Mailman.i18n import C_ +from Mailman.MailList import MailList from Mailman.MTA.Utils import makealiases from Mailman.Logging.Syslog import syslog @@ -132,6 +133,11 @@ def _addvirtual(mlist, fp): sitedest = Utils.ParseEmail(siteaddr)[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)): + siteaddr = '#' + siteaddr # 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) @@ -179,6 +185,9 @@ def _check_for_virtual_loopaddr(mlist, filename): loopdest = Utils.ParseEmail(loopaddr)[0] siteaddr = Utils.get_site_email(mlist.host_name) sitedest = Utils.ParseEmail(siteaddr)[0] + if mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN: + loopdest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN + sitedest += '@' + mm_cfg.VIRTUAL_MAILMAN_LOCAL_DOMAIN infp = open(filename) omask = os.umask(007) try: @@ -230,7 +239,7 @@ def _check_for_virtual_loopaddr(mlist, filename): print >> outfp, '%s\t%s' % (siteaddr, sitedest) outfp.write(line) break - elif line.startswith(siteaddr): + elif line.startswith(siteaddr) or line.startswith('#' + siteaddr): # We just found it outfp.write(line) break |