[CC'd to mutt-dev b/c of attached patch, I'm not on mutt-dev, so please
CC me in replies]

Cristian wrote:

> What has confused a few people is the fact that the patch is effective
> only if both pgp_outlook_compat and pgp_create_traditional are set.
> 
> > The proposal is to dump application/pgp, and make p_c_t result in
> > a plain text MIME type for clearsigned messages.
> 
> That's right. This can be achieved by integrating the patch into the
> next full release of Mutt.

No, NO, *NO*! 

pgp_outlook_compat will make a text/plain message, that is readable
properly in Outlook, but *only* *if* pgp_create_traditional succeeds.
Unfortunately p_c_t gets silently dropped for message which are not
us-ascii, i.e. most of my personal mails, since I use fancy stuff like
ä's and ö's and ü's and the like.

p_c_t and p_o_c break on iso-latin1 and on any mails with attachments,
so they are basically useless for a lot of people.

Here's a patch which creates pgp_force_traditional, which if
p_c_t is set, will always create a clear-signed PGP messages (not sure
for mails of attachments though).  That way, p_o_c can do the job it's
supposed to do.  I haven't tested it a lot since I wrote it, but it
appears to do the right thing.

Patch is against mutt-1.3.24, I'll test it tomorrow against 1.3.25, and
you need to have the pgp_outlook_compat patch applied first.

I don't know a lot about the mutt source, so this might break stuff,
haven't tested it a lot.

Cheers,
Viktor

(Should have gone to bed two hours ago.  Oh, well.)
-- 
Viktor Rosenfeld
WWW: http://www.informatik.hu-berlin.de/~rosenfel/
diff -ur mutt-1.3.24-outlook+compress/init.h mutt-1.3.24-vrr/init.h
--- mutt-1.3.24-outlook+compress/init.h Thu Jan  3 20:45:04 2002
+++ mutt-1.3.24-vrr/init.h      Thu Jan  3 20:39:56 2002
@@ -1311,6 +1311,25 @@
   ** to generate messages readable by users of MS Outlook using PGP.
   */
 
+  { "pgp_force_traditional", DT_BOOL, R_NONE, OPT_PGPFORCETRAD, 0},
+  /*
+  ** .pp
+  ** If pgp_create_traditional is defined above, this option will force
+  ** the creation of old-style PGP messages for text/plain messages, even when
+  ** the character set is different from us-ascii.
+  **
+  ** .pp
+  ** This option really only makes sense together with pgp_create_traditional
+  ** and pgp_outlook_compat; when all three are set, Outlook users will be
+  ** able to read any mail, including language-specific characters like
+  ** German umlauts, without problems.
+  **
+  ** .pp
+  ** Note, however, that using the old-style PGP message format is
+  ** \fBdeprecated\fP, and the using the old-style PGP message format with a
+  ** character set other than us-ascii might result in broken signatures.
+  */
+
   /* XXX Default values! */
   
   { "pgp_decode_command",      DT_STR, R_NONE, UL &PgpDecodeCommand, 0},
diff -ur mutt-1.3.24-outlook+compress/mutt.h mutt-1.3.24-vrr/mutt.h
--- mutt-1.3.24-outlook+compress/mutt.h Thu Jan  3 20:45:04 2002
+++ mutt-1.3.24-vrr/mutt.h      Thu Jan  3 20:30:56 2002
@@ -258,6 +258,7 @@
 #ifdef HAVE_PGP
   OPT_VERIFYSIG,      /* verify PGP signatures */
   OPT_PGPTRADITIONAL, /* create old-style PGP messages */
+  OPT_PGPFORCETRAD,   /* force old-style PGP messages even for non us-ascii */
   OPT_PGPOUTLOOK,     /* Create even older broken outlook compatible messages */
 #endif
 
diff -ur mutt-1.3.24-outlook+compress/pgp.c mutt-1.3.24-vrr/pgp.c
--- mutt-1.3.24-outlook+compress/pgp.c  Thu Jan  3 20:44:59 2002
+++ mutt-1.3.24-vrr/pgp.c       Fri Jan 11 01:21:47 2002
@@ -1646,7 +1646,9 @@
     
   b = mutt_new_body ();
   
-  b->encoding = ENC7BIT;
+  b->parameter = (PARAMETER *) malloc(sizeof(PARAMETER));  
+  b->parameter = memcpy(b->parameter, a->parameter, sizeof(PARAMETER));
+  b->encoding = a->encoding;
 
   /* Outlook seems to work by scanning the message itself for PGP information, */
   /* not the headers.  If the headers are anything but text/plain, it will */
@@ -1710,7 +1712,9 @@
 
   if ((msg->content->type == TYPETEXT) &&
       !ascii_strcasecmp (msg->content->subtype, "plain") &&
-      ((flags & PGPENCRYPT) || (msg->content->content && msg->content->content->hibin 
== 0)))
+      ((flags & PGPENCRYPT) || (msg->content->content &&
+                               msg->content->content->hibin == 0) ||
+       option(OPT_PGPFORCETRAD)))
   {
     if ((i = query_quadoption (OPT_PGPTRADITIONAL, _("Create an application/pgp 
message?"))) == -1)
       return -1;

Attachment: msg22870/pgp00000.pgp
Description: PGP signature

Reply via email to