Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
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
mediaserver
envsetup
Commits
2ff3f7ef
Verified
Commit
2ff3f7ef
authored
5 years ago
by
Nicolas KAROLAK
Browse files
Options
Downloads
Patches
Plain Diff
none attr cannot split
parent
1a36cf96
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_email.py
+13
-13
13 additions, 13 deletions
tests/test_email.py
with
13 additions
and
13 deletions
tests/test_email.py
+
13
−
13
View file @
2ff3f7ef
...
@@ -218,31 +218,31 @@ def main():
...
@@ -218,31 +218,31 @@ def main():
or
u
.
get_ip
()
or
u
.
get_ip
()
or
None
or
None
)
)
sender
=
conf
.
get
(
"
EMAIL_SENDER
"
)
or
None
sender
=
conf
.
get
(
"
EMAIL_SENDER
"
)
or
""
if
not
sender
and
Path
(
"
/etc/postfix/generic
"
).
exists
():
if
not
sender
and
Path
(
"
/etc/postfix/generic
"
).
exists
():
with
open
(
"
/etc/postfix/generic
"
)
as
sender_fo
:
with
open
(
"
/etc/postfix/generic
"
)
as
sender_fo
:
sender
=
sender_fo
.
readline
().
split
()[
-
1
]
sender
=
sender_fo
.
readline
().
split
()[
-
1
]
domain
=
sender
.
split
(
"
@
"
)[
-
1
]
or
None
domain
=
sender
.
split
(
"
@
"
)[
-
1
]
or
None
# check that we are not an open relay
# check that we are not an open relay
check_
listen_
warn
,
check_
listen_
err
=
check_listen
()
check_warn
,
check_err
=
check_listen
()
warnings
+=
check_
listen_
warn
if
check_
listen_
warn
else
warnings
warnings
+=
check_warn
if
check_warn
else
warnings
errors
+=
check_
listen_
err
if
check_
listen_
err
else
errors
errors
+=
check_err
if
check_err
else
errors
# check that relayhost is correct
# check that relayhost is correct
check_
relay_
warn
,
check_
relay_
err
=
check_relay
(
relay
,
domain
)
check_warn
,
check_err
=
check_relay
(
relay
,
domain
)
warnings
+=
check_
relay_
warn
if
check_
relay_
warn
else
warnings
warnings
+=
check_warn
if
check_warn
else
warnings
errors
+=
check_
relay_
err
if
check_
relay_
err
else
errors
errors
+=
check_err
if
check_err
else
errors
# check that we can send emails
# check that we can send emails
check_
send_
warn
,
check_
send_
err
=
check_send
(
sender
)
check_warn
,
check_err
=
check_send
(
sender
)
warnings
+=
check_
send_
warn
if
check_
send_
warn
else
warnings
warnings
+=
check_warn
if
check_warn
else
warnings
errors
+=
check_
send_
err
if
check_
send_
err
else
errors
errors
+=
check_err
if
check_err
else
errors
# check that spf record is correct
# check that spf record is correct
check_
spf_
warn
,
check_
spf_
err
=
check_spf
(
ip_addr
,
sender
,
domain
)
check_warn
,
check_err
=
check_spf
(
ip_addr
,
sender
,
domain
)
warnings
+=
check_
spf_
warn
if
check_
spf_
warn
else
warnings
warnings
+=
check_warn
if
check_warn
else
warnings
errors
+=
check_
spf_
err
if
check_
spf_
err
else
errors
errors
+=
check_err
if
check_err
else
errors
if
errors
:
if
errors
:
exit
(
1
)
exit
(
1
)
...
...
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