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
91c09dd0
Unverified
Commit
91c09dd0
authored
May 12, 2019
by
Honza Hommer
Browse files
ssmtp
parent
f6ca9233
Changes
1
Show whitespace changes
Inline
Side-by-side
notify/mail.sh
View file @
91c09dd0
...
@@ -15,12 +15,14 @@ mail_send() {
...
@@ -15,12 +15,14 @@ mail_send() {
if
_exists
"sendmail"
;
then
if
_exists
"sendmail"
;
then
_MAIL_BIN
=
"sendmail"
_MAIL_BIN
=
"sendmail"
elif
_exists
"ssmtp"
;
then
_MAIL_BIN
=
"ssmtp"
elif
_exists
"mutt"
;
then
elif
_exists
"mutt"
;
then
_MAIL_BIN
=
"mutt"
_MAIL_BIN
=
"mutt"
elif
_exists
"mail"
;
then
elif
_exists
"mail"
;
then
_MAIL_BIN
=
"mail"
_MAIL_BIN
=
"mail"
else
else
_err
"Please install sendmail or mail first."
_err
"Please install sendmail
, ssmtp, mutt
or mail first."
return
1
return
1
fi
fi
...
@@ -57,6 +59,9 @@ _mail_send() {
...
@@ -57,6 +59,9 @@ _mail_send() {
sendmail
)
sendmail
)
"
$_MAIL_BIN
"
-f
"
$MAIL_FROM
"
"
$MAIL_TO
"
"
$_MAIL_BIN
"
-f
"
$MAIL_FROM
"
"
$MAIL_TO
"
;;
;;
ssmtp
)
"
$_MAIL_BIN
"
"
$MAIL_TO
"
;;
mutt|mail
)
mutt|mail
)
"
$_MAIL_BIN
"
-s
"
$_subject
"
"
$MAIL_TO
"
"
$_MAIL_BIN
"
-s
"
$_subject
"
"
$MAIL_TO
"
;;
;;
...
@@ -64,7 +69,7 @@ _mail_send() {
...
@@ -64,7 +69,7 @@ _mail_send() {
}
}
_mail_body
()
{
_mail_body
()
{
if
[
"
$_MAIL_BIN
"
=
"sendmail"
]
;
then
if
[
"
$_MAIL_BIN
"
=
"sendmail"
]
||
[
"
$_MAIL_BIN
"
=
"ssmtp"
]
;
then
echo
"From:
$MAIL_FROM
"
echo
"From:
$MAIL_FROM
"
echo
"To:
$MAIL_TO
"
echo
"To:
$MAIL_TO
"
echo
"Subject:
$subject
"
echo
"Subject:
$subject
"
...
...
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