From 4a7fd0886acbb7d148af4c27b3897aeefcd5cfc8 Mon Sep 17 00:00:00 2001 From: Antonio Radici Date: Tue, 19 Jan 2010 22:03:40 +0000 Subject: [PATCH] do not write Bcc headers even if write_bcc is set * debian/patches: + debian-specific/467432-write_bcc.patch: do not write Bcc headers even if write_bcc is set (Closes: 467432, 546884, 467432) --- debian/changelog | 8 ++ .../debian-specific/467432-write_bcc.patch | 101 ++++++++++++++++++ debian/patches/debian-specific/Muttrc | 14 +-- debian/patches/series | 1 + 4 files changed, 118 insertions(+), 6 deletions(-) create mode 100644 debian/patches/debian-specific/467432-write_bcc.patch diff --git a/debian/changelog b/debian/changelog index 27ceeef..7d2aaa1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mutt (1.5.20-6) unstable; urgency=low + + * debian/patches: + + debian-specific/467432-write_bcc.patch: do not write Bcc headers + even if write_bcc is set (Closes: 467432, 546884, 467432) + + -- Antonio Radici Tue, 19 Jan 2010 21:57:48 +0000 + mutt (1.5.20-5) unstable; urgency=low * debian/patches: diff --git a/debian/patches/debian-specific/467432-write_bcc.patch b/debian/patches/debian-specific/467432-write_bcc.patch new file mode 100644 index 0000000..c075cdc --- /dev/null +++ b/debian/patches/debian-specific/467432-write_bcc.patch @@ -0,0 +1,101 @@ +The purpose of this patch is to alter the behavior of the write_bcc option +because exim4, the default SMTP in Debian, does not strip the Bcc headers; by +default write_bcc is set so this could cause a privacy leak. + +The behavior that this patch introduces is: never write the Bcc header when the +message is sent, otherwise, if the message is sent to Fcc, then this optin +will be evaluated and the Bcc header will be written based on that. + +Background discussion on this is in the following bugs: +http://bugs.debian.org/304718 +http://bugs.debian.org/467432 + +This patch is a slightly modified version of the patch provided by +Stefan Völkel in the second bug + +--- a/headers.c ++++ b/headers.c +@@ -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, 1); + fputc ('\n', ofp); /* tie off the header. */ + + /* now copy the body of the message. */ +--- a/init.h ++++ b/init.h +@@ -3365,14 +3365,9 @@ + { "write_bcc", DT_BOOL, R_NONE, OPTWRITEBCC, 1}, + /* + ** .pp +- ** Controls whether mutt writes out the ``Bcc:'' header when preparing +- ** messages to be sent. Exim users may wish to unset this. If mutt +- ** is set to deliver directly via SMTP (see $$smtp_url), this +- ** option does nothing: mutt will never write out the ``Bcc:'' header +- ** in this case. +- ** .pp +- ** \fBNote:\fP On Debian systems, exim4 and postfix strip BCC headers by +- ** default. The above warning applies to exim3 users, see /etc/Muttrc. ++ ** Controls whether mutt writes out the Bcc header when saving ++ ** messages to FCC. Bcc headers will never be written to a message ++ ** when sending it. Note: this behavior is Debian specific. + */ + { "write_inc", DT_NUM, R_NONE, UL &WriteInc, 10 }, + /* +--- a/protos.h ++++ b/protos.h +@@ -372,7 +372,7 @@ + int mutt_write_mime_body (BODY *, FILE *); + int mutt_write_mime_header (BODY *, FILE *); + int mutt_write_one_header (FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, int flags); +-int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int, int); ++int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int, int, int); + void mutt_write_references (LIST *, FILE *, int); + int mutt_yesorno (const char *, int); + void mutt_set_header_color(CONTEXT *, HEADER *); +--- a/send.c ++++ b/send.c +@@ -994,10 +994,10 @@ + unset_option (OPTWRITEBCC); + #endif + #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 + #ifdef USE_SMTP + if (old_write_bcc) +--- a/sendlib.c ++++ b/sendlib.c +@@ -1835,7 +1835,7 @@ + + + int mutt_write_rfc822_header (FILE *fp, ENVELOPE *env, BODY *attach, +- int mode, int privacy) ++ int mode, int privacy, int should_write_bcc) + { + char buffer[LONG_STRING]; + char *p, *q; +@@ -1878,7 +1878,7 @@ + else if (mode > 0) + fputs ("Cc: \n", fp); + +- if (env->bcc) ++ if (env->bcc && should_write_bcc) + { + if(mode != 0 || option(OPTWRITEBCC)) + { +@@ -2616,7 +2616,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, contians the + * Message-ID: of message replied to. Save it using a special X-Mutt- diff --git a/debian/patches/debian-specific/Muttrc b/debian/patches/debian-specific/Muttrc index 02173fa..5c93eff 100644 --- a/debian/patches/debian-specific/Muttrc +++ b/debian/patches/debian-specific/Muttrc @@ -5,7 +5,7 @@ --- a/doc/Muttrc.head +++ b/doc/Muttrc.head -@@ -12,6 +12,32 @@ unignore from: subject to cc date x-mail +@@ -12,6 +12,34 @@ # Display the fields in this order hdr_order date from to cc subject @@ -24,8 +24,10 @@ +# Specifies how to sort messages in the index menu. +set sort=threads + -+# Uncomment if your MTA does not strip Bcc: headers. -+# (postfix strips them, exim4 does not.) ++# The behavior of this option on the Debian mutt package is ++# not the original one because exim4, the default SMTP on Debian ++# does not strip bcc headers so this can cause privacy problems; ++# see man muttrc for more info +#unset write_bcc +# Postfix and qmail use Delivered-To for detecting loops +unset bounce_delivered @@ -38,7 +40,7 @@ # imitate the old search-body function macro index \eb "~b " "search in message bodies" -@@ -23,7 +49,7 @@ macro index,pager,attach,compose \cb "\ +@@ -23,7 +51,7 @@ "call urlview to extract URLs out of a message" # Show documentation when pressing F1 @@ -47,7 +49,7 @@ # show the incoming mailboxes list (just like "mutt -y") and back when pressing "y" macro index,pager y "?" "show incoming mailboxes list" -@@ -35,7 +61,7 @@ bind browser y exit +@@ -35,7 +63,7 @@ # append-hook \\.gz$ "gzip -c %t >> %f" # If Mutt is unable to determine your site's domain name correctly, you can @@ -56,7 +58,7 @@ # # set hostname=cs.hmc.edu -@@ -101,6 +127,9 @@ attachments +I text/plain +@@ -101,6 +129,9 @@ attachments -A message/external-body attachments -I message/external-body diff --git a/debian/patches/series b/debian/patches/series index b5e3544..7697e25 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -22,6 +22,7 @@ debian-specific/correct_docdir_in_man_page.diff debian-specific/dont_document_not_present_features.diff debian-specific/document_debian_defaults debian-specific/assumed_charset-compat +debian-specific/467432-write_bcc.patch misc/define-pgp_getkeys_command.diff misc/gpg.rc-paths misc/smime.rc -- 2.43.0