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
7c85694d
Commit
7c85694d
authored
Feb 23, 2015
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #332 from mathuin/better-mx-check
Changed MX check to respect priorities other than 10.
parents
7ec662c8
b2fcd4c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
status_checks.py
management/status_checks.py
+15
-6
No files found.
management/status_checks.py
View file @
7c85694d
...
...
@@ -416,13 +416,17 @@ def check_dnssec(domain, env, output, dns_zonefiles, is_checking_primary=False):
def
check_mail_domain
(
domain
,
env
,
output
):
# Check the MX record.
recommended_mx
=
"10 "
+
env
[
'PRIMARY_HOSTNAME'
]
mx
=
query_dns
(
domain
,
"MX"
,
nxdomain
=
None
)
expected_mx
=
"10 "
+
env
[
'PRIMARY_HOSTNAME'
]
if
mx
==
expected_mx
:
output
.
print_ok
(
"Domain's email is directed to this domain. [
%
s =>
%
s]"
%
(
domain
,
mx
))
if
mx
is
None
:
mxhost
=
None
else
:
# query_dns returns a semicolon-delimited list
# of priority-host pairs.
mxhost
=
mx
.
split
(
'; '
)[
0
]
.
split
(
' '
)[
1
]
elif
mx
==
None
:
if
mxhost
==
None
:
# A missing MX record is okay on the primary hostname because
# the primary hostname's A record (the MX fallback) is... itself,
# which is what we want the MX to be.
...
...
@@ -440,12 +444,17 @@ def check_mail_domain(domain, env, output):
else
:
output
.
print_error
(
"""This domain's DNS MX record is not set. It should be '
%
s'. Mail will not
be delivered to this box. It may take several hours for public DNS to update after a
change. This problem may result from other issues listed here."""
%
(
expect
ed_mx
,))
change. This problem may result from other issues listed here."""
%
(
recommend
ed_mx
,))
elif
mxhost
==
env
[
'PRIMARY_HOSTNAME'
]:
good_news
=
"Domain's email is directed to this domain. [
%
s =>
%
s]"
%
(
domain
,
mx
)
if
mx
!=
recommended_mx
:
good_news
+=
" This configuration is non-standard. The recommended configuration is '
%
s'."
%
(
recommended_mx
,)
output
.
print_ok
(
good_news
)
else
:
output
.
print_error
(
"""This domain's DNS MX record is incorrect. It is currently set to '
%
s' but should be '
%
s'. Mail will not
be delivered to this box. It may take several hours for public DNS to update after a change. This problem may result from
other issues listed here."""
%
(
mx
,
expect
ed_mx
))
other issues listed here."""
%
(
mx
,
recommend
ed_mx
))
# Check that the postmaster@ email address exists. Not required if the domain has a
# catch-all address or domain alias.
...
...
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