Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
18a42658
Commit
18a42658
authored
2 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Mail: Kontrola existence adres zohledňuje Null MX
Closes
#326
.
parent
6e8fca73
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/users.py
+8
-1
8 additions, 1 deletion
mo/users.py
with
8 additions
and
1 deletion
mo/users.py
+
8
−
1
View file @
18a42658
...
...
@@ -265,7 +265,14 @@ def email_check_domain(domain: str):
for
record
in
[
'
MX
'
,
'
A
'
,
'
AAAA
'
]:
try
:
dns
.
resolver
.
resolve
(
domain
,
record
,
lifetime
=
2
,
search
=
False
)
answer
=
dns
.
resolver
.
resolve
(
domain
,
record
,
lifetime
=
2
,
search
=
False
)
if
(
record
==
'
MX
'
and
len
(
answer
.
rrset
)
==
1
and
answer
.
rrset
[
0
].
preference
==
0
and
str
(
answer
.
rrset
[
0
].
exchange
)
==
'
.
'
):
# Null MX (RFC 7505) explicitně říká, že doména nepřijímá poštu
logger
.
info
(
f
'
DNS: Doména <
{
domain
}
> má Null NX
'
)
raise
mo
.
CheckError
(
f
'
Doména
{
domain
}
nepřijímá poštu
'
)
except
dns
.
exception
.
Timeout
:
# Kontrola je konzervativní, při timeoutu adresu raději schválíme
logger
.
info
(
f
'
DNS: Timeout při kontrole domény <
{
domain
}
>
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment