Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Seitosh
csback
Commits
1ad4a2fa
Commit
1ad4a2fa
authored
Sep 01, 2015
by
thomas.forbriger
Browse files
[WP] (csbackntfy): only use login mechanism if username is set
parent
5e86fffd
Changes
1
Show whitespace changes
Inline
Side-by-side
csbackntfy.py
View file @
1ad4a2fa
...
...
@@ -329,8 +329,7 @@ def main(argv=None):
if
0
==
len
(
host
):
raise
Usage
(
"Hostname missing."
,
eCodes
.
GLOBAL_UsageError
)
if
0
==
len
(
username
):
raise
Usage
(
"Username missing."
,
eCodes
.
GLOBAL_UsageError
)
if
0
!=
len
(
username
):
if
0
==
len
(
password
):
raise
Usage
(
"Password missing."
,
eCodes
.
GLOBAL_UsageError
)
if
-
1
==
port
:
...
...
@@ -400,6 +399,7 @@ def main(argv=None):
if
useTLS
:
session
.
starttls
()
session
.
ehlo
()
if
0
!=
len
(
username
):
session
.
login
(
username
,
password
)
session
.
sendmail
(
sender
,
receivers
,
mail
.
as_string
())
except
smtplib
.
SMTPRecipientsRefused
:
...
...
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