diff options
author | Mark Sapiro <mark@msapiro.net> | 2014-01-09 10:44:08 -0800 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2014-01-09 10:44:08 -0800 |
commit | e35952456ac54575b68dcea0c90764b9f0d940fa (patch) | |
tree | 6c5ee8d6d6f70d985d83fd6ff149c305fb19976f /Mailman | |
parent | 415f28f12f21b8e4ba0c86596c0d2d6dceb17ef0 (diff) | |
download | mailman2-e35952456ac54575b68dcea0c90764b9f0d940fa.tar.gz mailman2-e35952456ac54575b68dcea0c90764b9f0d940fa.tar.xz mailman2-e35952456ac54575b68dcea0c90764b9f0d940fa.zip |
Fixed POSTFIX_STYLE_VIRTUAL_DOMAINS to be case-insensitiive.
Diffstat (limited to '')
-rw-r--r-- | Mailman/MTA/Postfix.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Mailman/MTA/Postfix.py b/Mailman/MTA/Postfix.py index 801ddc0f..9987e4cf 100644 --- a/Mailman/MTA/Postfix.py +++ b/Mailman/MTA/Postfix.py @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2011 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2014 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -116,6 +116,10 @@ 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 +237,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 +308,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() |