aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2016-04-14 16:25:57 -0700
committerMark Sapiro <mark@msapiro.net>2016-04-14 16:25:57 -0700
commit5019dc01d25398b37596e86a7fa9c036576c4235 (patch)
treee5caf9f96a1df779bab21c175cdc3e6ded60a86a
parent1ced1bf606d8545d15437765f23f8004d196739b (diff)
downloadmailman2-5019dc01d25398b37596e86a7fa9c036576c4235.tar.gz
mailman2-5019dc01d25398b37596e86a7fa9c036576c4235.tar.xz
mailman2-5019dc01d25398b37596e86a7fa9c036576c4235.zip
Fixed missing VIRTUAL_MAILMAN_LOCAL_DOMAIN and duplicates in virtual-mailman.
-rw-r--r--Mailman/MTA/Postfix.py11
-rw-r--r--NEWS4
2 files changed, 14 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
diff --git a/NEWS b/NEWS
index 0c95a8b9..f110a3f7 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,10 @@ Here is a history of user visible changes to Mailman.
Bug fixes and other patches
+ - All addresses in data/virtual-mailman are now properly appended with
+ VIRTUAL_MAILMAN_LOCAL_DOMAIN and duplicates are not generated if the
+ site list is in a virtual domain. (LP: #1570630)
+
- DMARC mitigations will now find the From: domain to the right of the
rightmost '@' rather than the leftmost '@'. (LP: #1568445)