mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-22 21:21:42 +00:00
Only save config if send is successful
This commit is contained in:
parent
6e61c34f0f
commit
d48bff0e20
@ -78,6 +78,13 @@ smtp_send() {
|
|||||||
SMTP_TIMEOUT="${SMTP_TIMEOUT:-$(_readaccountconf_mutable SMTP_TIMEOUT)}"
|
SMTP_TIMEOUT="${SMTP_TIMEOUT:-$(_readaccountconf_mutable SMTP_TIMEOUT)}"
|
||||||
SMTP_DEFAULT_TIMEOUT="15"
|
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_FROM "$SMTP_FROM"
|
||||||
_saveaccountconf_mutable SMTP_TO "$SMTP_TO"
|
_saveaccountconf_mutable SMTP_TO "$SMTP_TO"
|
||||||
_saveaccountconf_mutable SMTP_HOST "$SMTP_HOST"
|
_saveaccountconf_mutable SMTP_HOST "$SMTP_HOST"
|
||||||
@ -87,12 +94,6 @@ smtp_send() {
|
|||||||
_saveaccountconf_mutable SMTP_PASSWORD "$SMTP_PASSWORD"
|
_saveaccountconf_mutable SMTP_PASSWORD "$SMTP_PASSWORD"
|
||||||
_saveaccountconf_mutable SMTP_TIMEOUT "$SMTP_TIMEOUT"
|
_saveaccountconf_mutable SMTP_TIMEOUT "$SMTP_TIMEOUT"
|
||||||
|
|
||||||
# Send the message:
|
|
||||||
if ! _smtp_send "$@"; then
|
|
||||||
_err "$smtp_send_output"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user