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
f09da719
Commit
f09da719
authored
Sep 08, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show the response from spamhaus.org in the status checks output
parent
e9e95cbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
status_checks.py
management/status_checks.py
+9
-6
No files found.
management/status_checks.py
View file @
f09da719
...
...
@@ -73,12 +73,13 @@ def run_network_checks(env):
# by a spammer, or the user may be deploying on a residential network. We
# will not be able to reliably send mail in these cases.
rev_ip4
=
"."
.
join
(
reversed
(
env
[
'PUBLIC_IP'
]
.
split
(
'.'
)))
if
not
query_dns
(
rev_ip4
+
'.zen.spamhaus.org'
,
'A'
,
nxdomain
=
None
):
zen
=
query_dns
(
rev_ip4
+
'.zen.spamhaus.org'
,
'A'
,
nxdomain
=
None
)
if
zen
is
None
:
env
[
'out'
]
.
print_ok
(
"IP address is not blacklisted by zen.spamhaus.org."
)
else
:
env
[
'out'
]
.
print_error
(
"""The IP address of this machine
%
s is listed in the Spamhaus Block List,
env
[
'out'
]
.
print_error
(
"""The IP address of this machine
%
s is listed in the Spamhaus Block List
(code
%
s)
,
which may prevent recipients from receiving your email. See http://www.spamhaus.org/query/ip/
%
s."""
%
(
env
[
'PUBLIC_IP'
],
env
[
'PUBLIC_IP'
]))
%
(
env
[
'PUBLIC_IP'
],
zen
,
env
[
'PUBLIC_IP'
]))
def
run_domain_checks
(
env
):
# Get the list of domains we handle mail for.
...
...
@@ -261,11 +262,13 @@ def check_mail_domain(domain, env):
# Stop if the domain is listed in the Spamhaus Domain Block List.
# The user might have chosen a domain that was previously in use by a spammer
# and will not be able to reliably send mail.
if
not
query_dns
(
domain
+
'.dbl.spamhaus.org'
,
"A"
,
nxdomain
=
None
):
dbl
=
query_dns
(
domain
+
'.dbl.spamhaus.org'
,
"A"
,
nxdomain
=
None
)
if
dbl
is
None
:
env
[
'out'
]
.
print_ok
(
"Domain is not blacklisted by dbl.spamhaus.org."
)
else
:
env
[
'out'
]
.
print_error
(
"""This domain is listed in the Spamhaus Domain Block List, which may prevent recipients from receiving your mail.
See http://www.spamhaus.org/dbl/ and http://www.spamhaus.org/query/domain/
%
s."""
%
domain
)
env
[
'out'
]
.
print_error
(
"""This domain is listed in the Spamhaus Domain Block List (code
%
s),
which may prevent recipients from receiving your mail.
See http://www.spamhaus.org/dbl/ and http://www.spamhaus.org/query/domain/
%
s."""
%
(
dbl
,
domain
))
def
check_web_domain
(
domain
,
env
):
# See if the domain's A record resolves to our PUBLIC_IP. This is already checked
...
...
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