]> granicus.if.org Git - mutt/commitdiff
header folding: treat From_ specially, never wrap on sending side
authorRocco Rutte <pdmef@gmx.net>
Thu, 25 Jun 2009 15:31:27 +0000 (17:31 +0200)
committerRocco Rutte <pdmef@gmx.net>
Thu, 25 Jun 2009 15:31:27 +0000 (17:31 +0200)
ChangeLog
sendlib.c

index f1ae7652d4d4f412f9de22a5b66c7ef405917e8a..3d8b22eec78ab13d2895e58bac36d261b7cbc9b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-06-25 14:36 +0200  Rocco Rutte  <pdmef@gmx.net>  (e0ec1856e3f3)
+
+       * sendlib.c: Add Date: header to postponed messages
+
+2009-06-25 14:29 +0200  Rocco Rutte  <pdmef@gmx.net>  (64402a72e968)
+
+       * ChangeLog, sendlib.c: Only add Status: header (fcc/postpone) when
+       saving to mbox/mmdf
+
 2009-06-25 14:29 +0200  Rocco Rutte  <pdmef@gmx.net>  (bd0828adede8)
 
        * compose.c: Treat messages written with <write-fcc> as fcc, not
index 00d808bc0d76e3d006fdcbe062a1b860b65451d7..437ff4c840a360448bc6cf80235d63e2584a128a 100644 (file)
--- 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));