From f1bd624622f01708e1efeac3c722060199fc8c93 Mon Sep 17 00:00:00 2001 From: SATOH Fumiyasu Date: Wed, 8 Jan 2014 16:23:34 +0900 Subject: [PATCH] Treat POSTFIX_STYLE_VIRTUAL_DOMAINS case-insensitively --- Mailman/MTA/Postfix.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Mailman/MTA/Postfix.py b/Mailman/MTA/Postfix.py index 801ddc0..796d05d 100644 --- a/Mailman/MTA/Postfix.py +++ b/Mailman/MTA/Postfix.py @@ -116,6 +116,12 @@ def _addlist(mlist, fp): +def _isvirtual(mlist): + return mlist and mlist.host_name.lower() \ + in [d.lower() for d in mm_cfg.POSTFIX_STYLE_VIRTUAL_DOMAINS] + + + def _addvirtual(mlist, fp): listname = mlist.internal_name() fieldsz = len(listname) + len('-unsubscribe') @@ -233,7 +239,7 @@ def create(mlist, cgi=False, nolock=False, quiet=False): # Do the aliases file, which need to be done in any case try: _do_create(mlist, ALIASFILE, _addlist) - if mlist and mlist.host_name in mm_cfg.POSTFIX_STYLE_VIRTUAL_DOMAINS: + if _isvirtual(mlist): _do_create(mlist, VIRTFILE, _addvirtual) # bin/genaliases is the only one that calls create with nolock = True. # Use that to only update the maps at the end of genaliases. @@ -304,7 +310,7 @@ def remove(mlist, cgi=False): lock.lock() try: _do_remove(mlist, ALIASFILE, False) - if mlist.host_name in mm_cfg.POSTFIX_STYLE_VIRTUAL_DOMAINS: + if _isvirtual(mlist): _do_remove(mlist, VIRTFILE, True) # Regenerate the alias and map files _update_maps() -- 1.8.5.2