From 85a40da83cfe6ec471cb369fa6efcbea63e74de3 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Mon, 19 Jan 2015 23:18:28 +0000 Subject: [PATCH] catch-all aiases and domain aliases should not require postmaster@ and admin@ aliases because they'll forward anyway --- CHANGELOG.md | 1 + management/mailconfig.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f6a3654..9eef4bf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Setup: Miscellaneous: * Internationalized domain names (IDNs) are now supported for DNS and web, but email is not yet tested. +* Domains that only have a catch-all alias or domain alias no longer automatically create/require admin@ and postmaster@ addresses since they'll forward anyway. v0.06 (January 4, 2015) diff --git a/management/mailconfig.py b/management/mailconfig.py index 6fbbbde2..3d789467 100755 --- a/management/mailconfig.py +++ b/management/mailconfig.py @@ -469,12 +469,12 @@ def get_required_aliases(env): aliases.add("hostmaster@" + env['PRIMARY_HOSTNAME']) # Get a list of domains we serve mail for, except ones for which the only - # email on that domain is a postmaster/admin alias to the administrator. + # email on that domain is a postmaster/admin alias to the administrator + # or a wildcard alias (since it will forward postmaster/admin). real_mail_domains = get_mail_domains(env, - filter_aliases = lambda alias : \ - (not alias[0].startswith("postmaster@") \ - and not alias[0].startswith("admin@")) \ - or alias[1] != get_system_administrator(env) \ + filter_aliases = lambda alias : + ((not alias[0].startswith("postmaster@") and not alias[0].startswith("admin@")) or alias[1] != get_system_administrator(env)) + and not alias[0].startswith("@") ) # Create postmaster@ and admin@ for all domains we serve mail on.