From: Rocco Rutte Date: Thu, 25 Jun 2009 15:31:27 +0000 (+0200) Subject: header folding: treat From_ specially, never wrap on sending side X-Git-Tag: mutt-1-5-21-rel~201 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a49f73480c6c690056cb7086622a098a4739f03;p=mutt header folding: treat From_ specially, never wrap on sending side --- diff --git a/ChangeLog b/ChangeLog index f1ae7652..3d8b22ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-25 14:36 +0200 Rocco Rutte (e0ec1856e3f3) + + * sendlib.c: Add Date: header to postponed messages + +2009-06-25 14:29 +0200 Rocco Rutte (64402a72e968) + + * ChangeLog, sendlib.c: Only add Status: header (fcc/postpone) when + saving to mbox/mmdf + 2009-06-25 14:29 +0200 Rocco Rutte (bd0828adede8) * compose.c: Treat messages written with as fcc, not diff --git a/sendlib.c b/sendlib.c index 00d808bc..437ff4c8 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1639,9 +1639,9 @@ static int fold_one_header (FILE *fp, const char *tag, const char *value, dprint(4,(debugfile,"mwoh: pfx=[%s], tag=[%s], flags=%d value=[%s]\n", pfx, tag, flags, value)); - if (fprintf (fp, "%s%s: ", NONULL (pfx), tag) < 0) + if (tag && *tag && fprintf (fp, "%s%s: ", NONULL (pfx), tag) < 0) return -1; - col = mutt_strlen (tag) + 2 + mutt_strlen (pfx); + col = mutt_strlen (tag) + (tag && *tag ? 2 : 0) + mutt_strlen (pfx); while (p && *p) { @@ -1726,9 +1726,12 @@ static int write_one_header (FILE *fp, int pfxw, int max, int wraplen, int flags) { char *tagbuf, *valbuf, *t; + int is_from = ((end - start) > 5 && + ascii_strncasecmp (start, "from ", 5) == 0); - /* only pass through folding machinery if necessary for sending */ - if (!(flags & CH_DISPLAY) && pfxw + max <= wraplen) + /* only pass through folding machinery if necessary for sending, + never wrap From_ headers on sending */ + if (!(flags & CH_DISPLAY) && (pfxw + max <= wraplen || is_from)) { valbuf = mutt_substrdup (start, end); dprint(4,(debugfile,"mwoh: buf[%s%s] short enough, " @@ -1759,8 +1762,16 @@ static int write_one_header (FILE *fp, int pfxw, int max, int wraplen, "'key: value' format!\n")); return 0; } - tagbuf = mutt_substrdup (start, t); - valbuf = mutt_substrdup (t + 2, end); + if (is_from) + { + tagbuf = NULL; + valbuf = mutt_substrdup (start, end); + } + else + { + tagbuf = mutt_substrdup (start, t); + valbuf = mutt_substrdup (t + 2, end); + } dprint(4,(debugfile,"mwoh: buf[%s%s] too long, " "max width = %d > %d\n", NONULL(pfx), valbuf, max, wraplen));