X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/dff60e00f801f70b89b10651d4a0fcdcdbed31d5..d435a3111f03e3c9b0ad7f307a3f09076f47c05e:/.mutt/sendmail-checks.d/check-attachments diff --git a/.mutt/sendmail-checks.d/check-attachments b/.mutt/sendmail-checks.d/check-attachments old mode 100755 new mode 100644 index 81ff561..fe80dc0 --- a/.mutt/sendmail-checks.d/check-attachments +++ b/.mutt/sendmail-checks.d/check-attachments @@ -21,10 +21,10 @@ RE_FRENCH='attach(e|er|(é|=E9|=C3=A9)e?s?|ement|ant)' OVERRIDE_HEADER=X-No-Attach if ! grep -qi "^${OVERRIDE_HEADER}:" "$1" \ - && egrep -ziq "($RE_ENGLISH|$RE_GERMAN|$RE_FRENCH)" "$1"; then + && egrep -v '^(> |Content-Disposition:)' "$1" | egrep -qzi "($RE_ENGLISH|$RE_GERMAN|$RE_FRENCH)"; then - nr_attach=$(sed -rne 's/^Content-Type:[[:space:]]+//p' "$1" | - egrep -cv '^(multipart/|application/pgp-signature)') + nr_attach=$(sed -rne 's/^Content-Type:[[:space:]]+//pi' "$1" | + egrep -civ '^(multipart/|application/pgp-signature)') if [ $nr_attach -lt 2 ]; then echo >&2 "E: the mail message likely references an attachment,"