From: markus schnalke Date: Fri, 2 Oct 2015 17:49:38 +0000 (+0200) Subject: mhbuild: Avoid a dot on a line on its own X-Git-Tag: mmh-0.2-RC1~17 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=92e279e1255b12b02a2faede6e1d66b46f731807;hp=c6cf5c38fb74a2399cc656357be571f1669a36d1 mhbuild: Avoid a dot on a line on its own mhbuild's quoted-printable encoder breaks lines to have at most CPERLIN chars. If the it happens that the last character on the line is a dot (`.') and the line is broken just before it, then the following line contains nothing but one single dot. This currently leads to problems in mmh ... but it may cause problems to other mail software as well. Hence we avoid it by encoding any dot at the beginning of a line, just to be sure. --- diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c index 21c2e26..ba88319 100644 --- a/uip/mhoutsbr.c +++ b/uip/mhoutsbr.c @@ -241,8 +241,16 @@ writeQuoted(CT ct, FILE *out) break; default: - if (*cp < '!' || *cp > '~') + if (*cp < '!' || *cp > '~') { goto three_print; + } + if (n == 0 && *cp == '.') { + /* + ** encode dot at start of line, + ** because it could be alone ... + */ + goto three_print; + } putc(*cp, out); n++; break;