mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 01e4e942dddd1c933ba92f32f77902390860d187
parent 09f3f66eb9e5006a66e4364ad20763cc2fd8161c
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Fri, 29 Jul 2016 16:41:45 +0200

rfc2045: relax MIME check

Some mails don't have MIME-Version: 1.0, having
Content-Transfer-Encoding shall be good enough either

Diffstat:
rfc2045.c | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/rfc2045.c b/rfc2045.c @@ -13,11 +13,16 @@ int blaze822_check_mime(struct message *msg) { char *v = blaze822_hdr(msg, "mime-version"); - return (v && + if (v && v[0] && v[0] == '1' && v[1] && v[1] == '.' && v[2] && v[2] == '0' && - (!v[3] || iswsp(v[3]))); + (!v[3] || iswsp(v[3]))) + return 1; + v = blaze822_hdr(msg, "content-transfer-encoding"); + if (v) + return 1; + return 0; } int