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
6e61c34f
Commit
6e61c34f
authored
Dec 29, 2020
by
medmunds
Committed by
Alexander Kulumbeg
Mar 21, 2021
Browse files
Make shfmt happy
(I'm open to better ways of formatting the heredoc that embeds the Python script.)
parent
2d9506eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
notify/smtp.sh
View file @
6e61c34f
...
@@ -63,13 +63,13 @@ smtp_send() {
...
@@ -63,13 +63,13 @@ smtp_send() {
SMTP_SECURE
=
"
${
SMTP_SECURE
:-
$(
_readaccountconf_mutable SMTP_SECURE
)
}
"
SMTP_SECURE
=
"
${
SMTP_SECURE
:-
$(
_readaccountconf_mutable SMTP_SECURE
)
}
"
SMTP_SECURE
=
"
${
SMTP_SECURE
:-
none
}
"
SMTP_SECURE
=
"
${
SMTP_SECURE
:-
none
}
"
case
"
$SMTP_SECURE
"
in
case
"
$SMTP_SECURE
"
in
"none"
)
SMTP_DEFAULT_PORT
=
"25"
;;
"none"
)
SMTP_DEFAULT_PORT
=
"25"
;;
"ssl"
)
SMTP_DEFAULT_PORT
=
"465"
;;
"ssl"
)
SMTP_DEFAULT_PORT
=
"465"
;;
"tls"
)
SMTP_DEFAULT_PORT
=
"587"
;;
"tls"
)
SMTP_DEFAULT_PORT
=
"587"
;;
*
)
*
)
_err
"Invalid SMTP_SECURE='
$SMTP_SECURE
'. It must be 'ssl', 'tls' or 'none'."
_err
"Invalid SMTP_SECURE='
$SMTP_SECURE
'. It must be 'ssl', 'tls' or 'none'."
return
1
return
1
;;
;;
esac
esac
SMTP_USERNAME
=
"
${
SMTP_USERNAME
:-
$(
_readaccountconf_mutable SMTP_USERNAME
)
}
"
SMTP_USERNAME
=
"
${
SMTP_USERNAME
:-
$(
_readaccountconf_mutable SMTP_USERNAME
)
}
"
...
@@ -125,7 +125,8 @@ _smtp_send() {
...
@@ -125,7 +125,8 @@ _smtp_send() {
fi
fi
# language=Python
# language=Python
smtp_send_output
=
"
$(
$SMTP_PYTHON
<<
EOF
smtp_send_output
=
"
$(
$SMTP_PYTHON
<<
EOF
# This code is meant to work with either Python 2.7.x or Python 3.4+.
# This code is meant to work with either Python 2.7.x or Python 3.4+.
try:
try:
try:
try:
...
@@ -189,7 +190,7 @@ finally:
...
@@ -189,7 +190,7 @@ finally:
if smtp is not None:
if smtp is not None:
smtp.quit()
smtp.quit()
EOF
EOF
)
"
)
"
_ret
=
$?
_ret
=
$?
_debug
"smtp_send_output"
"
$smtp_send_output
"
_debug
"smtp_send_output"
"
$smtp_send_output
"
return
"
$_ret
"
return
"
$_ret
"
...
...
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