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

Re: mutt/2111: ESMTP patch: does not strip Bcc: header



On Fri, Oct 14, 2005 at 01:24:01PM -0400, Derek Martin wrote:
> > The problem with unsetting write_bcc is IIRC that then the header
> > won't appear in the fcc folder. And sometimes it's good to be able to
> > lookup who got the mail via Bcc.
[...]
> Now that I think about it, I believe that is the "correct" behavior
> which mutt should exhibit.  If I have the time this weekend, I'll hack
> up a quick patch to make mutt do this.

This one was quite easy.  It forces the Bcc line to be written to the
fcc, regardless of the value of $write_bcc, so that the user can
always see who the Bcc recipients were.  Tested, applies against the
current CVS (and probably any recent version of mutt, since the
changes needed are so very small).

Please apply the attached patch.

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail.  Sorry for the inconvenience.  Thank the spammers.

diff -r -u mutt-cvs-2005-10-15/headers.c mutt-cvs-2005-10-15.ddm/headers.c
--- mutt-cvs-2005-10-15/headers.c       2005-09-17 16:46:10.000000000 -0400
+++ mutt-cvs-2005-10-15.ddm/headers.c   2005-10-15 13:05:49.000000000 -0400
@@ -52,7 +52,7 @@
   }
   
   mutt_env_to_local (msg->env);
-  mutt_write_rfc822_header (ofp, msg->env, NULL, 1, 0);
+  mutt_write_rfc822_header (ofp, msg->env, NULL, 1, 0, 0);
   fputc ('\n', ofp);   /* tie off the header. */
 
   /* now copy the body of the message. */
diff -r -u mutt-cvs-2005-10-15/protos.h mutt-cvs-2005-10-15.ddm/protos.h
--- mutt-cvs-2005-10-15/protos.h        2005-10-04 02:05:39.000000000 -0400
+++ mutt-cvs-2005-10-15.ddm/protos.h    2005-10-15 13:06:10.000000000 -0400
@@ -353,7 +353,7 @@
 int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int, 
char *);
 int mutt_write_mime_body (BODY *, FILE *);
 int mutt_write_mime_header (BODY *, FILE *);
-int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int, int);
+int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int, int, int);
 int mutt_yesorno (const char *, int);
 void mutt_set_header_color(CONTEXT *, HEADER *);
 void mutt_sleep (short);
diff -r -u mutt-cvs-2005-10-15/send.c mutt-cvs-2005-10-15.ddm/send.c
--- mutt-cvs-2005-10-15/send.c  2005-10-03 03:52:00.000000000 -0400
+++ mutt-cvs-2005-10-15.ddm/send.c      2005-10-15 13:06:46.000000000 -0400
@@ -969,10 +969,10 @@
     return (-1);
 
 #ifdef MIXMASTER
-  mutt_write_rfc822_header (tempfp, msg->env, msg->content, 0, msg->chain ? 1 
: 0);
+  mutt_write_rfc822_header (tempfp, msg->env, msg->content, 0, msg->chain ? 1 
: 0, 0);
 #endif
 #ifndef MIXMASTER
-  mutt_write_rfc822_header (tempfp, msg->env, msg->content, 0, 0);
+  mutt_write_rfc822_header (tempfp, msg->env, msg->content, 0, 0, 0);
 #endif
   
   fputc ('\n', tempfp); /* tie off the header. */
diff -r -u mutt-cvs-2005-10-15/sendlib.c mutt-cvs-2005-10-15.ddm/sendlib.c
--- mutt-cvs-2005-10-15/sendlib.c       2005-09-29 19:02:49.000000000 -0400
+++ mutt-cvs-2005-10-15.ddm/sendlib.c   2005-10-15 13:04:22.000000000 -0400
@@ -1531,10 +1531,12 @@
  *               Output generated is suitable for being sent through
  *              anonymous remailer chains.
  *
+ * fcc != 0 => force writing of bcc, even if $write_bcc=no (for fcc)
+ *
  */
 
 int mutt_write_rfc822_header (FILE *fp, ENVELOPE *env, BODY *attach, 
-                             int mode, int privacy)
+                             int mode, int privacy, int fcc)
 {
   char buffer[LONG_STRING];
   char *p;
@@ -1572,7 +1574,7 @@
 
   if (env->bcc)
   {
-    if(mode != 0 || option(OPTWRITEBCC))
+    if(mode != 0 || option(OPTWRITEBCC) || fcc)
     {
       fputs ("Bcc: ", fp);
       mutt_write_address_list (env->bcc, fp, 5, 0);
@@ -2319,7 +2321,7 @@
   /* post == 1 => postpone message. Set mode = -1 in mutt_write_rfc822_header()
    * post == 0 => Normal mode. Set mode = 0 in mutt_write_rfc822_header() 
    * */
-  mutt_write_rfc822_header (msg->fp, hdr->env, hdr->content, post ? -post : 0, 
0);
+  mutt_write_rfc822_header (msg->fp, hdr->env, hdr->content, post ? -post : 0, 
0, 1);
 
   /* (postponment) if this was a reply of some sort, <msgid> contians the
    * Message-ID: of message replied to.  Save it using a special X-Mutt-

Attachment: pgpPXatU1b9fO.pgp
Description: PGP signature