From 3e300b97e9a54a3157e37948f8827abbe3eecf05 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Tue, 27 Mar 2012 00:13:25 +0200 Subject: [PATCH] Added Content-Description header with the filename of the attachment. This seems to be common practice now and gives mhlist something useful to display. Merged from nmh. Thanks to David Levine. --- man/send.man1 | 1 + uip/send.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/man/send.man1 b/man/send.man1 index 7b368ea..09e3f40 100644 --- a/man/send.man1 +++ b/man/send.man1 @@ -65,6 +65,7 @@ A message part header for an attachment might be: .PP .nf Content-Type: text/plain; name="VERSION"; charset="us-ascii" +Content-Description: VERSION Content-Disposition: attachment; filename="VERSION" .fi .PP diff --git a/uip/send.c b/uip/send.c index a735c67..e39ab80 100644 --- a/uip/send.c +++ b/uip/send.c @@ -630,9 +630,9 @@ make_mime_composition_file_entry(char *file_name) adios(NULL, "unable to access file `%s'", file_name); } - fprintf(composition_file, "#%s; name=\"%s\" <>{attachment}", - content_type, - (!(cp = strrchr(file_name, '/'))) ? file_name : cp + 1); + cp = (!(cp = strrchr(file_name, '/'))) ? file_name : cp + 1; + fprintf(composition_file, "#%s; name=\"%s\" <> [%s] {attachment}", + content_type, cp, cp); fprintf(composition_file, " %s\n", file_name); -- 1.7.10.4