1 The purpose of this patch is to alter the behavior of the write_bcc option
2 because exim4, the default SMTP in Debian, does not strip the Bcc headers; by
3 default write_bcc is set so this could cause a privacy leak.
5 The behavior that this patch introduces is: never write the Bcc header when the
6 message is sent, otherwise, if the message is sent to Fcc, then this optin
7 will be evaluated and the Bcc header will be written based on that.
9 Background discussion on this is in the following bugs:
10 http://bugs.debian.org/304718
11 http://bugs.debian.org/467432
13 This patch is a slightly modified version of the patch provided by
14 Stefan Völkel <stefan@bc-bd.org> in the second bug
21 mutt_env_to_local (msg->env);
22 - mutt_write_rfc822_header (ofp, msg->env, NULL, 1, 0);
23 + mutt_write_rfc822_header (ofp, msg->env, NULL, 1, 0, 1);
24 fputc ('\n', ofp); /* tie off the header. */
26 /* now copy the body of the message. */
29 @@ -3365,14 +3365,9 @@
30 { "write_bcc", DT_BOOL, R_NONE, OPTWRITEBCC, 1},
33 - ** Controls whether mutt writes out the ``Bcc:'' header when preparing
34 - ** messages to be sent. Exim users may wish to unset this. If mutt
35 - ** is set to deliver directly via SMTP (see $$smtp_url), this
36 - ** option does nothing: mutt will never write out the ``Bcc:'' header
39 - ** \fBNote:\fP On Debian systems, exim4 and postfix strip BCC headers by
40 - ** default. The above warning applies to exim3 users, see /etc/Muttrc.
41 + ** Controls whether mutt writes out the Bcc header when saving
42 + ** messages to FCC. Bcc headers will never be written to a message
43 + ** when sending it. Note: this behavior is Debian specific.
45 { "write_inc", DT_NUM, R_NONE, UL &WriteInc, 10 },
50 int mutt_write_mime_body (BODY *, FILE *);
51 int mutt_write_mime_header (BODY *, FILE *);
52 int mutt_write_one_header (FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, int flags);
53 -int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int, int);
54 +int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int, int, int);
55 void mutt_write_references (LIST *, FILE *, int);
56 int mutt_yesorno (const char *, int);
57 void mutt_set_header_color(CONTEXT *, HEADER *);
61 unset_option (OPTWRITEBCC);
64 - mutt_write_rfc822_header (tempfp, msg->env, msg->content, 0, msg->chain ? 1 : 0);
65 + mutt_write_rfc822_header (tempfp, msg->env, msg->content, 0, msg->chain ? 1 : 0, 0);
68 - mutt_write_rfc822_header (tempfp, msg->env, msg->content, 0, 0);
69 + mutt_write_rfc822_header (tempfp, msg->env, msg->content, 0, 0, 0);
78 int mutt_write_rfc822_header (FILE *fp, ENVELOPE *env, BODY *attach,
79 - int mode, int privacy)
80 + int mode, int privacy, int should_write_bcc)
82 char buffer[LONG_STRING];
89 + if (env->bcc && should_write_bcc)
91 if(mode != 0 || option(OPTWRITEBCC))
94 /* post == 1 => postpone message. Set mode = -1 in mutt_write_rfc822_header()
95 * post == 0 => Normal mode. Set mode = 0 in mutt_write_rfc822_header()
97 - mutt_write_rfc822_header (msg->fp, hdr->env, hdr->content, post ? -post : 0, 0);
98 + mutt_write_rfc822_header (msg->fp, hdr->env, hdr->content, post ? -post : 0, 0, 1);
100 /* (postponment) if this was a reply of some sort, <msgid> contians the
101 * Message-ID: of message replied to. Save it using a special X-Mutt-