From: martin f. krafft Date: Fri, 13 Mar 2009 06:47:48 +0000 (+0100) Subject: properly mime-decode subject lines X-Git-Url: https://git.madduck.net/etc/mailfilter.git/commitdiff_plain/cfe663608f803381baba0f83e392fb6270f266b6?hp=32e39db7360a2150d184f096ef0b770ade647627 properly mime-decode subject lines --- diff --git a/procmail/defines b/procmail/defines index bdc3167..e10d302 100644 --- a/procmail/defines +++ b/procmail/defines @@ -136,14 +136,10 @@ INCLUDERC=$PMDIR/get-msgid { SUBJECT=$MATCH - # mimedecode.c: * Disclaimer: We only handle charset of iso-8859-1 :0 - * SUBJECT ?? =\?iso-8859-1\?[QBqb]\?.+\?= + * SUBJECT ?? =\?.+\?[QBqb]\?.+\?= { - DECODED="`echo Subject: $SUBJECT | mimedecode | iconv -f latin1 -t utf-8`" - :0 - *$ DECODED ?? ^Subject:$RE_EXTRACT_HEADER_VALUE - { SUBJECT=$MATCH } + SUBJECT="`PERL_UNICODE=S perl -MEncode=decode -e \"print decode(\\\"MIME-Header\\\", \\\"$SUBJECT\\\") . \\\"\n\\\";\"`" } }