From 0b689562cafc05b1a36bdea3d025c9ecdf2514bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Mon, 10 May 2021 00:12:10 +0700 Subject: mailinfo: warn if CRLF found in decoded base64/QP email MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When SMTP servers receive 8-bit email messages, possibly with only LF as line ending, some of them decide to change said LF to CRLF. Some mailing list softwares, when receive 8-bit email messages, decide to encode those messages in base64 or quoted-printable. If an email is transfered through above mail servers, then distributed by such mailing list softwares, the recipients will receive an email contains a patch mungled with CRLF encoded inside another encoding. Thus, such CR (in CRLF) couldn't be dropped by "mailsplit". Hence, the mailed patch couldn't be applied cleanly. Such accidents have been observed in the wild [1]. Instead of silently rejecting those messages, let's give our users some warnings if such CR (as part of CRLF) is found. [1]: https://nmbug.notmuchmail.org/nmweb/show/m2lf9ejegj.fsf%40guru.guru-group.fi Signed-off-by: Đoàn Trần Công Danh Signed-off-by: Junio C Hamano --- mailinfo.h | 1 + 1 file changed, 1 insertion(+) (limited to 'mailinfo.h') diff --git a/mailinfo.h b/mailinfo.h index 79b1d6774e..b394ef9bce 100644 --- a/mailinfo.h +++ b/mailinfo.h @@ -24,6 +24,7 @@ struct mailinfo { struct strbuf charset; unsigned int format_flowed:1; unsigned int delsp:1; + unsigned int have_quoted_cr:1; char *message_id; enum { TE_DONTCARE, TE_QP, TE_BASE64 -- cgit v1.2.3