On Wed, May 30, 2007 at 04:52:36PM +0200, Alain Bench wrote:
> On Wednesday, May 30, 2007 at 13:58:41 +0200, Lionel Elie Mamane wrote:
>> There is already a patch that does just that: make $write_bcc not
>> impact $record.
> Which patch?
The one in the Gmane link.
> The Gmane link you gave unfortunately doesn't work for me.
Ah, herewith attached then.
> The only patch I tested doing that was posted to the mutt-users
> mailing list by Derek D. Martin some 2 years ago, in the "write_bcc
> and fcc" thread, and IIRC it worked well. Is it this one?
It seems to be that one, yes.
--
Lionel
Index: mutt-1.5.13/headers.c
===================================================================
--- mutt-1.5.13.orig/headers.c 2007-02-02 07:36:08.702994078 +0100
+++ mutt-1.5.13/headers.c 2007-02-02 07:36:44.361485909 +0100
@@ -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. */
Index: mutt-1.5.13/protos.h
===================================================================
--- mutt-1.5.13.orig/protos.h 2007-02-02 07:37:01.438679271 +0100
+++ mutt-1.5.13/protos.h 2007-02-02 07:37:32.168826707 +0100
@@ -356,7 +356,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);
Index: mutt-1.5.13/send.c
===================================================================
--- mutt-1.5.13.orig/send.c 2007-02-02 07:37:47.889946353 +0100
+++ mutt-1.5.13/send.c 2007-02-02 07:38:14.875832274 +0100
@@ -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. */
Index: mutt-1.5.13/sendlib.c
===================================================================
--- mutt-1.5.13.orig/sendlib.c 2007-02-02 07:38:27.808736095 +0100
+++ mutt-1.5.13/sendlib.c 2007-02-02 07:40:06.299671285 +0100
@@ -1536,10 +1536,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;
@@ -1577,7 +1579,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);
@@ -2324,7 +2326,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-