Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
fad69f85
Commit
fad69f85
authored
Dec 07, 2015
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #605 from ariejan/feature/604-add-rfc2142-mail-aliases
Add alias for abuse@
parents
0029811d
aedfe62b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
CHANGELOG.md
CHANGELOG.md
+2
-1
mailconfig.py
management/mailconfig.py
+10
-6
aliases.html
management/templates/aliases.html
+1
-1
No files found.
CHANGELOG.md
View file @
fad69f85
...
@@ -7,6 +7,7 @@ Still In Development
...
@@ -7,6 +7,7 @@ Still In Development
Mail:
Mail:
*
Updated Roundcube to version 1.1.3.
*
Updated Roundcube to version 1.1.3.
*
Auto-create RFC2142 aliases for abuse@.
Control panel:
Control panel:
...
@@ -394,7 +395,7 @@ v0.02 (September 21, 2014)
...
@@ -394,7 +395,7 @@ v0.02 (September 21, 2014)
*
Better logic for determining when to take a full backup.
*
Better logic for determining when to take a full backup.
*
Reduce DNS TTL, not that it seems to really matter.
*
Reduce DNS TTL, not that it seems to really matter.
*
Add SSHFP DNS records.
*
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.
*
Update to ownCloud 7.0.2.
*
Some things were broken if the machine had an IPv6 address.
*
Some things were broken if the machine had an IPv6 address.
*
Use a dialogs library to ask users questions during setup.
*
Use a dialogs library to ask users questions during setup.
...
...
management/mailconfig.py
View file @
fad69f85
...
@@ -77,7 +77,7 @@ def prettify_idn_email_address(email):
...
@@ -77,7 +77,7 @@ def prettify_idn_email_address(email):
def
is_dcv_address
(
email
):
def
is_dcv_address
(
email
):
email
=
email
.
lower
()
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
+
"+"
):
if
email
.
startswith
(
localpart
+
"@"
)
or
email
.
startswith
(
localpart
+
"+"
):
return
True
return
True
return
False
return
False
...
@@ -520,17 +520,21 @@ def get_required_aliases(env):
...
@@ -520,17 +520,21 @@ def get_required_aliases(env):
# email on that domain are the required aliases or a catch-all/domain-forwarder.
# email on that domain are the required aliases or a catch-all/domain-forwarder.
real_mail_domains
=
get_mail_domains
(
env
,
real_mail_domains
=
get_mail_domains
(
env
,
filter_aliases
=
lambda
alias
:
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
(
"@"
)
and
not
alias
.
startswith
(
"@"
)
)
)
# Create postmaster@
and admin@ for all domains we serve mail on.
# Create postmaster@
, admin@ and abuse@ for all domains we serve
#
postmaster@ is assumed to exist by our Postfix configuration. admin@
#
mail on. postmaster@ is assumed to exist by our Postfix configuration.
# isn't anything, but it might save the user some trouble e.g. when
#
admin@
isn't anything, but it might save the user some trouble e.g. when
# buying an SSL certificate.
# buying an SSL certificate.
# abuse@ is part of RFC2142: https://www.ietf.org/rfc/rfc2142.txt
for
domain
in
real_mail_domains
:
for
domain
in
real_mail_domains
:
aliases
.
add
(
"postmaster@"
+
domain
)
aliases
.
add
(
"postmaster@"
+
domain
)
aliases
.
add
(
"admin@"
+
domain
)
aliases
.
add
(
"admin@"
+
domain
)
aliases
.
add
(
"abuse@"
+
domain
)
return
aliases
return
aliases
...
@@ -572,7 +576,7 @@ def kick(env, mail_result=None):
...
@@ -572,7 +576,7 @@ def kick(env, mail_result=None):
# longer have any other email addresses for.
# longer have any other email addresses for.
for
address
,
forwards_to
,
*
_
in
existing_alias_records
:
for
address
,
forwards_to
,
*
_
in
existing_alias_records
:
user
,
domain
=
address
.
split
(
"@"
)
user
,
domain
=
address
.
split
(
"@"
)
if
user
in
(
"postmaster"
,
"admin"
)
\
if
user
in
(
"postmaster"
,
"admin"
,
"abuse"
)
\
and
address
not
in
required_aliases
\
and
address
not
in
required_aliases
\
and
forwards_to
==
get_system_administrator
(
env
):
and
forwards_to
==
get_system_administrator
(
env
):
remove_mail_alias
(
address
,
env
,
do_kick
=
False
)
remove_mail_alias
(
address
,
env
,
do_kick
=
False
)
...
...
management/templates/aliases.html
View file @
fad69f85
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
</tbody>
</tbody>
</table>
</table>
<p
style=
"margin-top: 1.5em"
><small>
hostmaster@, postmaster@, a
nd admin
@ email addresses are required on some domains.
</small></p>
<p
style=
"margin-top: 1.5em"
><small>
hostmaster@, postmaster@, a
dmin@ and abuse
@ email addresses are required on some domains.
</small></p>
<div
style=
"display: none"
>
<div
style=
"display: none"
>
<table>
<table>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment