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
a89a6207
Unverified
Commit
a89a6207
authored
May 12, 2019
by
Honza Hommer
Browse files
cleanup, lint
parent
f6f6d89e
Changes
1
Hide whitespace changes
Inline
Side-by-side
notify/mail.sh
View file @
a89a6207
...
@@ -18,7 +18,7 @@ mail_send() {
...
@@ -18,7 +18,7 @@ mail_send() {
elif
_exists
"mail"
;
then
elif
_exists
"mail"
;
then
_MAIL_BIN
=
"mail"
_MAIL_BIN
=
"mail"
else
else
_err
"Please install mail or
send
mail first."
_err
"Please install
send
mail or mail first."
return
1
return
1
fi
fi
...
@@ -36,6 +36,7 @@ mail_send() {
...
@@ -36,6 +36,7 @@ mail_send() {
fi
fi
_saveaccountconf_mutable MAIL_TO
"
$MAIL_TO
"
_saveaccountconf_mutable MAIL_TO
"
$MAIL_TO
"
contenttype
=
"text/plain; charset=utf-8"
subject
=
"=?UTF-8?B?
$(
echo
"
$_subject
"
| _base64
)
?="
subject
=
"=?UTF-8?B?
$(
echo
"
$_subject
"
| _base64
)
?="
result
=
$(
{
_mail_body | _mail_send
;
}
2>&1
)
result
=
$(
{
_mail_body | _mail_send
;
}
2>&1
)
...
@@ -52,10 +53,10 @@ mail_send() {
...
@@ -52,10 +53,10 @@ mail_send() {
_mail_send
()
{
_mail_send
()
{
case
"
$_MAIL_BIN
"
in
case
"
$_MAIL_BIN
"
in
sendmail
)
sendmail
)
sendmail
-f
"
$MAIL_FROM
"
"
$MAIL_TO
"
"
$_MAIL_BIN
"
-f
"
$MAIL_FROM
"
"
$MAIL_TO
"
;;
;;
mail
)
mail
)
mail
-s
"
$subject
"
-a
"From:
$MAIL_FROM
"
-a
"Content-Type:
text/plain; charset=utf-8
"
"
$MAIL_TO
"
"
$_MAIL_BIN
"
-s
"
$subject
"
-a
"From:
$MAIL_FROM
"
-a
"Content-Type:
$contenttype
"
"
$MAIL_TO
"
;;
;;
esac
esac
}
}
...
@@ -64,8 +65,8 @@ _mail_body() {
...
@@ -64,8 +65,8 @@ _mail_body() {
if
[
"
$_MAIL_BIN
"
=
"sendmail"
]
;
then
if
[
"
$_MAIL_BIN
"
=
"sendmail"
]
;
then
echo
"From:
$MAIL_FROM
"
echo
"From:
$MAIL_FROM
"
echo
"To:
$MAIL_TO
"
echo
"To:
$MAIL_TO
"
echo
"Subject:
=?UTF-8?B?
$(
echo
"
$_subject
"
| _base64
)
?=
"
echo
"Subject:
$subject
"
echo
"Content-Type:
text/plain; charset=utf-8
"
echo
"Content-Type:
$contenttype
"
echo
echo
fi
fi
...
...
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