Skip to content

Commit 0ea84ad

Browse files
authored
Merge pull request #4528 from chris03/bugfix/replace-expr
SMTP notify: Use grep -E instead of expr
2 parents fe6b27b + 1522b71 commit 0ea84ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

notify/smtp.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ _clean_email_header() {
169169
# email
170170
_email_has_display_name() {
171171
_email="$1"
172-
expr "$_email" : '^.*[<>"]' >/dev/null
172+
echo "$_email" | grep -q -E '^.*[<>"]'
173173
}
174174

175175
##
@@ -249,7 +249,7 @@ _mime_encoded_word() {
249249
_text="$1"
250250
# (regex character ranges like [a-z] can be locale-dependent; enumerate ASCII chars to avoid that)
251251
_ascii='] $`"'"[!#%&'()*+,./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ~^_abcdefghijklmnopqrstuvwxyz{|}~-"
252-
if expr "$_text" : "^.*[^$_ascii]" >/dev/null; then
252+
if echo "$_text" | grep -q -E "^.*[^$_ascii]"; then
253253
# At least one non-ASCII char; convert entire thing to encoded word
254254
printf "%s" "=?UTF-8?B?$(printf "%s" "$_text" | _base64)?="
255255
else

0 commit comments

Comments
 (0)