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
65fb65ad
Commit
65fb65ad
authored
Jul 07, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
an mx record may be missing if the A record matches the A record of PRIMARY_HOSTNAME
parent
28e254fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
whats_next.py
management/whats_next.py
+24
-6
No files found.
management/whats_next.py
View file @
65fb65ad
...
...
@@ -158,17 +158,35 @@ def check_dns_zone(domain, env, dns_zonefiles):
print
(
""
)
def
check_mail_domain
(
domain
,
env
):
# Check the MX record. A missing MX record is okay on the primary hostname
# because the primary hostname's A record (the MX fallback) is... itself,
# which s what we want the MX to be.
# Check the MX record.
mx
=
query_dns
(
domain
,
"MX"
,
nxdomain
=
None
)
expected_mx
=
"10 "
+
env
[
'PRIMARY_HOSTNAME'
]
if
mx
==
expected_mx
:
print_ok
(
"Domain's email is directed to this domain. [
%
s =>
%
s]"
%
(
domain
,
mx
))
elif
mx
==
None
and
domain
==
env
[
'PRIMARY_HOSTNAME'
]:
print_ok
(
"Domain's email is directed to this domain. [
%
s has no MX record, which is ok]"
%
(
domain
,))
elif
mx
==
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.
if
domain
==
env
[
'PRIMARY_HOSTNAME'
]:
print_ok
(
"Domain's email is directed to this domain. [
%
s has no MX record, which is ok]"
%
(
domain
,))
# And a missing MX record is okay on other domains if the A record
# matches the A record of the PRIMARY_HOSTNAME. Actually this will
# probably confuse DANE TLSA, but we'll let that slide for now.
else
:
domain_a
=
query_dns
(
domain
,
"A"
,
nxdomain
=
None
)
primary_a
=
query_dns
(
env
[
'PRIMARY_HOSTNAME'
],
"A"
,
nxdomain
=
None
)
if
domain_a
!=
None
and
domain_a
==
primary_a
:
print_ok
(
"Domain's email is directed to this domain. [
%
s has no MX record but its A record is OK]"
%
(
domain
,))
else
:
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."""
%
(
expected_mx
,))
else
:
if
mx
==
None
:
mx
=
"[Not Set]"
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
,
expected_mx
))
...
...
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