aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/MTA
diff options
context:
space:
mode:
authorYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-05-13 03:54:42 +0900
committerYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-05-13 03:54:42 +0900
commit92fe2d084b3db7c533b3860428afccec7af95036 (patch)
tree70b89624a61f75cb8efb7c10a9a37abe5fb7bb16 /Mailman/MTA
parent0d0624665b0a1f1779e2fb7a670b39fd7509258f (diff)
parentd2145608089777cd27175763cf9f71ca2a3159f5 (diff)
downloadmailman2-92fe2d084b3db7c533b3860428afccec7af95036.tar.gz
mailman2-92fe2d084b3db7c533b3860428afccec7af95036.tar.xz
mailman2-92fe2d084b3db7c533b3860428afccec7af95036.zip
Merge lp:mailman/2.1 up to rev 1649
Diffstat (limited to 'Mailman/MTA')
-rw-r--r--Mailman/MTA/Postfix.py11
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