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

How to send mail with a sign gpg in attachment like "signature.asc" ?



Because this can make m$ mail client happy, like Enigmail does.

Thanks your patch, it make my patch work very easy.

2008/2/16, Sertaç Ö. Yıldız <sertac.liste@xxxxxxxxx>:
> I don't know why you need to set the disposition to "attachment" instead
> of "inline". If you just need to lookout for correspondents with
> clueless mail readers, try the attached patch I'm using. I wonder why
> this feature does not exist in in vanilla mutt.
>
$OpenBSD$
--- pgp.c.orig  Wed Apr 25 04:12:16 2007
+++ pgp.c       Sat Feb 16 16:15:36 2008
@@ -35,6 +35,7 @@
 #include "pgp.h"
 #include "mime.h"
 #include "copy.h"
+#include "rfc2047.h" /* for content-description */
 
 #include <sys/wait.h>
 #include <string.h>
@@ -1104,9 +1105,13 @@ BODY *pgp_sign_message (BODY *a)
   t->type = TYPEAPPLICATION;
   t->subtype = safe_strdup ("pgp-signature");
   t->filename = safe_strdup (sigfile);
-  t->use_disp = 0;
-  t->disposition = DISPINLINE;
+  t->use_disp = 1;
+  t->disposition = DISPATTACH;
   t->encoding = ENC7BIT;
+  t->d_filename = safe_strdup ("signature.asc");
+  t->description = safe_strdup (_("Digital Signature"));
+  rfc2047_encode_string (&t->description);
+  mutt_set_parameter ("name", "signature.asc", &t->parameter);
   t->unlink = 1; /* ok to remove this file after sending. */
 
   return (a);
$OpenBSD$
--- crypt-gpgme.c.orig  Fri Jul 27 03:43:39 2007
+++ crypt-gpgme.c       Sat Feb 16 16:15:14 2008
@@ -34,6 +34,7 @@
 #include "copy.h"
 #include "pager.h"
 #include "sort.h"
+#include "rfc2047.h" /* for content-description */
 
 #include <sys/wait.h>
 #include <string.h>
@@ -893,13 +894,19 @@ static BODY *sign_message (BODY *a, int use_smime)
       t->use_disp = 1;
       t->disposition = DISPATTACH;
       t->d_filename = safe_strdup ("smime.p7s");
+      t->description = safe_strdup (_("Digital Signature"));
+      rfc2047_encode_string (&t->description);
     }
   else
     {
       t->subtype = safe_strdup ("pgp-signature");
-      t->use_disp = 0;
-      t->disposition = DISPINLINE;
+      mutt_set_parameter ("name", "signature.asc", &t->parameter);
+      t->use_disp = 1;
+      t->disposition = DISPATTACH;
       t->encoding = ENC7BIT;
+      t->d_filename = safe_strdup ("signature.asc");
+      t->description = safe_strdup (_("Digital Signature"));
+      rfc2047_encode_string (&t->description);
     }
   t->filename = sigfile;
   t->unlink = 1; /* ok to remove this file after sending. */

Attachment: signature.asc
Description: Digital Signature