Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
d48bff0e
Commit
d48bff0e
authored
Jan 11, 2021
by
medmunds
Committed by
Alexander Kulumbeg
Mar 21, 2021
Browse files
Only save config if send is successful
parent
6e61c34f
Changes
1
Hide whitespace changes
Inline
Side-by-side
notify/smtp.sh
View file @
d48bff0e
...
...
@@ -78,6 +78,13 @@ smtp_send() {
SMTP_TIMEOUT
=
"
${
SMTP_TIMEOUT
:-
$(
_readaccountconf_mutable SMTP_TIMEOUT
)
}
"
SMTP_DEFAULT_TIMEOUT
=
"15"
# Send the message:
if
!
_smtp_send
"
$@
"
;
then
_err
"
$smtp_send_output
"
return
1
fi
# Save remaining config if successful. (SMTP_PYTHON is saved earlier.)
_saveaccountconf_mutable SMTP_FROM
"
$SMTP_FROM
"
_saveaccountconf_mutable SMTP_TO
"
$SMTP_TO
"
_saveaccountconf_mutable SMTP_HOST
"
$SMTP_HOST
"
...
...
@@ -87,12 +94,6 @@ smtp_send() {
_saveaccountconf_mutable SMTP_PASSWORD
"
$SMTP_PASSWORD
"
_saveaccountconf_mutable SMTP_TIMEOUT
"
$SMTP_TIMEOUT
"
# Send the message:
if
!
_smtp_send
"
$@
"
;
then
_err
"
$smtp_send_output
"
return
1
fi
return
0
}
...
...
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