<<< Date Index >>>     <<< Thread Index >>>

[PATCH] Fine-tune sun mailtool support (was: Obsolete features)



Hi,

* Moritz Barsnick [06-05-20 10:05:47 +0200] wrote:

The feature could be improved though:
In the attachments view, I just see the name "default" for every
attachment with the header
X-Sun-Data-Description: default
(which is - apparently - all of them).
It should probably make use of the header
X-Sun-Data-Name: filename.ext

SCNR - I don't honestly believe you'll change a thing with that
feature!

Well, at least I try to keep mail archives for eternity and others maybe do the same. So, once we have support for it, we should support it as good as possible, right?

The attached patch fixes at least your problem: if there is a 'X-Sun-Data-Description: default' line, we assume now the sender didn't adjust this setting and use X-Sun-Data-Name _even_ with respect to $rfc2047_parameters... :)

Feel free to use it if the committers don't commit it to upstream... which I could understand... somehow :)

  bye, Rocco
--
:w!
diff --git a/parse.c b/parse.c
index 8676b79..16201ce 100644
--- a/parse.c
+++ b/parse.c
@@ -485,6 +485,18 @@ #ifdef SUN_ATTACHMENT
        mutt_str_replace (&p->description, c);
         rfc2047_decode (&p->description);
       }
+      else if (!ascii_strcasecmp ("data-name", line + 6) &&
+              !ascii_strcasecmp (p->description, "default"))
+      {
+       /*
+        * if we had a 'x-sun-data-description: default' header so far,
+        * assume the sender didn't adjust the default value and
+        * use x-sun-data-name instead with respecting $rfc2047_parameters
+        */
+       mutt_str_replace (&p->description, c);
+       if (option (OPTRFC2047PARAMS))
+         rfc2047_decode (&p->description);
+      }
     }
 #endif
   }