From aedfe62bb07d304891873c3e0bbcd07ff14aef0d Mon Sep 17 00:00:00 2001 From: Ariejan de Vroom Date: Mon, 23 Nov 2015 15:12:33 +0100 Subject: [PATCH] Add alias for abuse@ --- CHANGELOG.md | 3 ++- management/mailconfig.py | 16 ++++++++++------ management/templates/aliases.html | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fec01d8..76409a21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Still In Development Mail: * Updated Roundcube to version 1.1.3. +* Auto-create RFC2142 aliases for abuse@. Control panel: @@ -392,7 +393,7 @@ v0.02 (September 21, 2014) * Better logic for determining when to take a full backup. * Reduce DNS TTL, not that it seems to really matter. * Add SSHFP DNS records. -* Add an API for setting custom DNS records +* Add an API for setting custom DNS records * Update to ownCloud 7.0.2. * Some things were broken if the machine had an IPv6 address. * Use a dialogs library to ask users questions during setup. diff --git a/management/mailconfig.py b/management/mailconfig.py index 17fa9499..d9ffdf65 100755 --- a/management/mailconfig.py +++ b/management/mailconfig.py @@ -77,7 +77,7 @@ def prettify_idn_email_address(email): def is_dcv_address(email): email = email.lower() - for localpart in ("admin", "administrator", "postmaster", "hostmaster", "webmaster"): + for localpart in ("admin", "administrator", "postmaster", "hostmaster", "webmaster", "abuse"): if email.startswith(localpart+"@") or email.startswith(localpart+"+"): return True return False @@ -520,17 +520,21 @@ def get_required_aliases(env): # email on that domain are the required aliases or a catch-all/domain-forwarder. real_mail_domains = get_mail_domains(env, filter_aliases = lambda alias : - not alias.startswith("postmaster@") and not alias.startswith("admin@") + not alias.startswith("postmaster@") + and not alias.startswith("admin@") + and not alias.startswith("abuse@") and not alias.startswith("@") ) - # Create postmaster@ and admin@ for all domains we serve mail on. - # postmaster@ is assumed to exist by our Postfix configuration. admin@ - # isn't anything, but it might save the user some trouble e.g. when + # Create postmaster@, admin@ and abuse@ for all domains we serve + # mail on. postmaster@ is assumed to exist by our Postfix configuration. + # admin@isn't anything, but it might save the user some trouble e.g. when # buying an SSL certificate. + # abuse@ is part of RFC2142: https://www.ietf.org/rfc/rfc2142.txt for domain in real_mail_domains: aliases.add("postmaster@" + domain) aliases.add("admin@" + domain) + aliases.add("abuse@" + domain) return aliases @@ -572,7 +576,7 @@ def kick(env, mail_result=None): # longer have any other email addresses for. for address, forwards_to, *_ in existing_alias_records: user, domain = address.split("@") - if user in ("postmaster", "admin") \ + if user in ("postmaster", "admin", "abuse") \ and address not in required_aliases \ and forwards_to == get_system_administrator(env): remove_mail_alias(address, env, do_kick=False) diff --git a/management/templates/aliases.html b/management/templates/aliases.html index 215e728c..dc916f95 100644 --- a/management/templates/aliases.html +++ b/management/templates/aliases.html @@ -86,7 +86,7 @@ -

hostmaster@, postmaster@, and admin@ email addresses are required on some domains.

+

hostmaster@, postmaster@, admin@ and abuse@ email addresses are required on some domains.