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
0ea84ad7
Unverified
Commit
0ea84ad7
authored
Mar 01, 2023
by
neil
Committed by
GitHub
Mar 01, 2023
Browse files
Merge pull request #4528 from chris03/bugfix/replace-expr
SMTP notify: Use grep -E instead of expr
parents
fe6b27bb
1522b713
Changes
1
Hide whitespace changes
Inline
Side-by-side
notify/smtp.sh
View file @
0ea84ad7
...
@@ -169,7 +169,7 @@ _clean_email_header() {
...
@@ -169,7 +169,7 @@ _clean_email_header() {
# email
# email
_email_has_display_name
()
{
_email_has_display_name
()
{
_email
=
"
$1
"
_email
=
"
$1
"
e
xpr
"
$_email
"
:
'^.*[<>"]'
>
/dev/null
e
cho
"
$_email
"
|
grep
-q
-E
'^.*[<>"]'
}
}
##
##
...
@@ -249,7 +249,7 @@ _mime_encoded_word() {
...
@@ -249,7 +249,7 @@ _mime_encoded_word() {
_text
=
"
$1
"
_text
=
"
$1
"
# (regex character ranges like [a-z] can be locale-dependent; enumerate ASCII chars to avoid that)
# (regex character ranges like [a-z] can be locale-dependent; enumerate ASCII chars to avoid that)
_ascii
=
'] $`"'
"[!#%&'()*+,./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ~^_abcdefghijklmnopqrstuvwxyz{|}~-"
_ascii
=
'] $`"'
"[!#%&'()*+,./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ~^_abcdefghijklmnopqrstuvwxyz{|}~-"
if
e
xpr
"
$_text
"
:
"^.*[^
$_ascii
]"
>
/dev/null
;
then
if
e
cho
"
$_text
"
|
grep
-q
-E
"^.*[^
$_ascii
]"
;
then
# At least one non-ASCII char; convert entire thing to encoded word
# At least one non-ASCII char; convert entire thing to encoded word
printf
"%s"
"=?UTF-8?B?
$(
printf
"%s"
"
$_text
"
| _base64
)
?="
printf
"%s"
"=?UTF-8?B?
$(
printf
"%s"
"
$_text
"
| _base64
)
?="
else
else
...
...
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