[-- Attachment #1: Type: text/plain, Size: 404 bytes --] There is a new pull request by codesoap against master on the mblaze repository https://github.com/codesoap/mblaze shebang https://github.com/leahneukirchen/mblaze/pull/196 mcom: do not match shebang in needs_multipart() Avoids matching lines like '#!/usr/bin/env sh'. Also require at least one character after '/'. A patch file from https://github.com/leahneukirchen/mblaze/pull/196.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-shebang-196.patch --] [-- Type: text/x-diff, Size: 631 bytes --] From af81899c0cdb6cee5664ea57bdadd87d93af359c Mon Sep 17 00:00:00 2001 From: codesoap <codesoap@mailbox.org> Date: Mon, 4 Jan 2021 18:55:48 +0100 Subject: [PATCH] mcom: do not match shebang in needs_multipart() Avoids matching lines like '#!/usr/bin/env sh'. Also require at least one character after '/'. --- mcom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcom b/mcom index f0de75c..c869fe3 100755 --- a/mcom +++ b/mcom @@ -75,7 +75,7 @@ stripempty() { needs_multipart() { mhdr -h attach "$1" >/dev/null || - grep -q '^#[^ ]*/[^ ]* ' "$1" + grep -qE '^#[^! ][^ ]*/[^ ]+ ' "$1" } do_mime() {
[-- Attachment #1: Type: text/plain, Size: 182 bytes --] New comment by leahneukirchen on mblaze repository https://github.com/leahneukirchen/mblaze/pull/196#issuecomment-754126694 Comment: Ok, but running mmime does no harm here right?
[-- Attachment #1: Type: text/plain, Size: 196 bytes --] New comment by leahneukirchen on mblaze repository https://github.com/leahneukirchen/mblaze/pull/196#issuecomment-754126894 Comment: I'd probably use a regexp that matches what we do in mmime.c
[-- Attachment #1: Type: text/plain, Size: 405 bytes --] New comment by codesoap on mblaze repository https://github.com/leahneukirchen/mblaze/pull/196#issuecomment-754131640 Comment: > Ok, but running mmime does no harm here right? Running mmime doesn't do much harm, but it changes the message encoding from `text/plain` to `multipart/mixed`. > I'd probably use a regexp that matches what we do in mmime.c OK, thanks for the hint. I'll take a look.
[-- Attachment #1: Type: text/plain, Size: 168 bytes --] New comment by leahneukirchen on mblaze repository https://github.com/leahneukirchen/mblaze/pull/196#issuecomment-754132219 Comment: `#[a-zA-Z]+/[a-zA-Z-#]+ ` maybe?
[-- Attachment #1: Type: text/plain, Size: 171 bytes --] New comment by leahneukirchen on mblaze repository https://github.com/leahneukirchen/mblaze/pull/196#issuecomment-754132219 Comment: `#[a-zA-Z]+/[a-zA-Z0-9#-]+ ` maybe?
[-- Attachment #1: Type: text/plain, Size: 175 bytes --] New comment by leahneukirchen on mblaze repository https://github.com/leahneukirchen/mblaze/pull/196#issuecomment-754132219 Comment: `#[a-zA-Z]+/[a-zA-Z0-9+.;=#-]+ ` maybe?
[-- Attachment #1: Type: text/plain, Size: 176 bytes --] New comment by codesoap on mblaze repository https://github.com/leahneukirchen/mblaze/pull/196#issuecomment-754133988 Comment: Looks good to me. Ill update the pull request.
[-- Attachment #1: Type: text/plain, Size: 409 bytes --] There is an updated pull request by codesoap against master on the mblaze repository https://github.com/codesoap/mblaze shebang https://github.com/leahneukirchen/mblaze/pull/196 mcom: do not match shebang in needs_multipart() Avoids matching lines like `#!/usr/bin/env sh`. Also require at least one character after `/`. A patch file from https://github.com/leahneukirchen/mblaze/pull/196.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-shebang-196.patch --] [-- Type: text/x-diff, Size: 596 bytes --] From e37d2102e32977e4f17fb9c560fb0bcd6743b4be Mon Sep 17 00:00:00 2001 From: codesoap <codesoap@mailbox.org> Date: Mon, 4 Jan 2021 18:55:48 +0100 Subject: [PATCH] mcom: do not match shebang in needs_multipart() Avoids matching lines like '#!/usr/bin/env sh'. --- mcom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcom b/mcom index f0de75c..c378b33 100755 --- a/mcom +++ b/mcom @@ -75,7 +75,7 @@ stripempty() { needs_multipart() { mhdr -h attach "$1" >/dev/null || - grep -q '^#[^ ]*/[^ ]* ' "$1" + grep -qE '^#[a-zA-Z]+/[a-zA-Z0-9+.;=#-]+ ' "$1" } do_mime() {
[-- Attachment #1: Type: text/plain, Size: 177 bytes --] New comment by codesoap on mblaze repository https://github.com/leahneukirchen/mblaze/pull/196#issuecomment-754133988 Comment: Looks good to me. I'll update the pull request.
[-- Attachment #1: Type: text/plain, Size: 263 bytes --] There's a closed pull request on the mblaze repository mcom: do not match shebang in needs_multipart() https://github.com/leahneukirchen/mblaze/pull/196 Description: Avoids matching lines like `#!/usr/bin/env sh`. Also require at least one character after `/`.