Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
6e49c4ff
Commit
6e49c4ff
authored
Feb 17, 2021
by
medmunds
Browse files
Prefer Python to curl when both available
parent
28d9f006
Changes
1
Show whitespace changes
Inline
Side-by-side
notify/smtp.sh
View file @
6e49c4ff
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
# SMTP_USERNAME="" # set if SMTP server requires login
# SMTP_USERNAME="" # set if SMTP server requires login
# SMTP_PASSWORD="" # set if SMTP server requires login
# SMTP_PASSWORD="" # set if SMTP server requires login
# SMTP_TIMEOUT="30" # seconds for SMTP operations to timeout
# SMTP_TIMEOUT="30" # seconds for SMTP operations to timeout
# SMTP_BIN="/path/to/
curl_or_python
" # default finds first of
curl,
python3,
or
python on PATH
# SMTP_BIN="/path/to/
python_or_curl
" # default finds first of python3, python
2.7, python, pypy3, pypy, curl
on PATH
SMTP_SECURE_DEFAULT
=
"none"
SMTP_SECURE_DEFAULT
=
"none"
SMTP_TIMEOUT_DEFAULT
=
"30"
SMTP_TIMEOUT_DEFAULT
=
"30"
...
@@ -36,7 +36,7 @@ smtp_send() {
...
@@ -36,7 +36,7 @@ smtp_send() {
# Look for a command that can communicate with an SMTP server.
# Look for a command that can communicate with an SMTP server.
# (Please don't add sendmail, ssmtp, mutt, mail, or msmtp here.
# (Please don't add sendmail, ssmtp, mutt, mail, or msmtp here.
# Those are already handled by the "mail" notify hook.)
# Those are already handled by the "mail" notify hook.)
for
cmd
in
curl
python3 python2.7 python pypy3 pypy
;
do
for
cmd
in
python3 python2.7 python pypy3 pypy
curl
;
do
if
_exists
"
$cmd
"
;
then
if
_exists
"
$cmd
"
;
then
SMTP_BIN
=
"
$cmd
"
SMTP_BIN
=
"
$cmd
"
break
break
...
...
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