[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mutt übergibt BCC and Sendmail/Exim



Servus,

ich habe mal 2 Patches zusammengezimmert, beide gegen das entsprechende
entpackte Debian Source Paket:

	- mutt übergibt bcc nicht mehr an sendmail oder smtp
	- write_bcc == true => bcc wird im FCC geschrieben

Use at own risk und so ...

	Stefan
-- 
BOFH excuse #82:

Yeah, yo mama dresses you funny and you need a mouse to delete files.
diff --git a/debian/patches/debian-specific/Muttrc b/debian/patches/debian-specific/Muttrc
index bc8db21..747feb2 100644
--- a/debian/patches/debian-specific/Muttrc
+++ b/debian/patches/debian-specific/Muttrc
@@ -3,9 +3,11 @@
  * 2009-01-15 myon: refreshed for mutt-1.5.19; drop our list of ignored headers
    in favor of upstream's new unignore list
 
---- a/doc/Muttrc.head
-+++ b/doc/Muttrc.head
-@@ -12,6 +12,32 @@ unignore from: subject to cc date x-mail
+Index: mutt-1.5.19/doc/Muttrc.head
+===================================================================
+--- mutt-1.5.19.orig/doc/Muttrc.head	2009-05-28 17:55:09.165491420 +0200
++++ mutt-1.5.19/doc/Muttrc.head	2009-05-28 18:02:57.960620539 +0200
+@@ -12,6 +12,31 @@
  # Display the fields in this order
  hdr_order date from to cc subject
  
@@ -24,9 +26,8 @@
 +# Specifies how to sort messages in the index menu.
 +set sort=threads
 +
-+# Uncomment if your MTA does not strip Bcc: headers.
-+# (exim4 and postfix strip them, exim(3) does not.)
-+#unset write_bcc
++# Do not write out Bcc headers
++unset write_bcc
 +# Postfix and qmail use Delivered-To for detecting loops
 +unset bounce_delivered
 +
@@ -38,7 +39,7 @@
  # imitate the old search-body function
  macro index \eb "<search>~b " "search in message bodies"
  
-@@ -23,7 +49,7 @@ macro index,pager,attach,compose \cb "\
+@@ -23,7 +48,7 @@
  "call urlview to extract URLs out of a message"
  
  # Show documentation when pressing F1
@@ -47,7 +48,7 @@
  
  # show the incoming mailboxes list (just like "mutt -y") and back when pressing "y"
  macro index,pager y "<change-folder>?<toggle-mailboxes>" "show incoming mailboxes list"
-@@ -35,7 +61,7 @@ bind browser y exit
+@@ -35,7 +60,7 @@
  # append-hook \\.gz$ "gzip -c %t >> %f"
  
  # If Mutt is unable to determine your site's domain name correctly, you can
@@ -56,7 +57,7 @@
  #
  # set hostname=cs.hmc.edu
  
-@@ -101,6 +127,9 @@ attachments   +I text/plain
+@@ -101,6 +126,9 @@
  attachments   -A message/external-body
  attachments   -I message/external-body
  
diff --git a/debian/patches/debian-specific/document_debian_defaults b/debian/patches/debian-specific/document_debian_defaults
index 523c928..d9e6b4e 100644
--- a/debian/patches/debian-specific/document_debian_defaults
+++ b/debian/patches/debian-specific/document_debian_defaults
@@ -64,13 +64,3 @@ only on Debian systems
    */
    { "sort_alias",	DT_SORT|DT_SORT_ALIAS,	R_NONE,	UL &SortAlias, SORT_ALIAS },
    /*
-@@ -3306,6 +3325,9 @@ struct option_t MuttVars[] = {
-   ** 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.
-   */
-   {"xterm_icon",       DT_STR,   R_BOTH, UL &XtermIcon,  UL "M%?n?AIL&ail?"},
-   /*
diff --git a/debian/patches/debian-specific/write_bcc b/debian/patches/debian-specific/write_bcc
new file mode 100644
index 0000000..94eadc3
--- /dev/null
+++ b/debian/patches/debian-specific/write_bcc
@@ -0,0 +1,93 @@
+Index: mutt-1.5.19/headers.c
+===================================================================
+--- mutt-1.5.19.orig/headers.c	2008-08-15 20:30:12.000000000 +0200
++++ mutt-1.5.19/headers.c	2009-05-28 18:06:04.775043761 +0200
+@@ -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. */
+Index: mutt-1.5.19/init.h
+===================================================================
+--- mutt-1.5.19.orig/init.h	2009-05-28 18:05:29.411476313 +0200
++++ mutt-1.5.19/init.h	2009-05-28 18:06:47.787229756 +0200
+@@ -3339,11 +3339,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.
++  ** 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.
+   */
+   {"xterm_icon",       DT_STR,   R_BOTH, UL &XtermIcon,  UL "M%?n?AIL&ail?"},
+   /*
+Index: mutt-1.5.19/protos.h
+===================================================================
+--- mutt-1.5.19.orig/protos.h	2009-01-05 20:20:53.000000000 +0100
++++ mutt-1.5.19/protos.h	2009-05-28 18:07:10.787454963 +0200
+@@ -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 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 *);
+Index: mutt-1.5.19/send.c
+===================================================================
+--- mutt-1.5.19.orig/send.c	2009-01-05 20:20:53.000000000 +0100
++++ mutt-1.5.19/send.c	2009-05-28 18:06:04.848692790 +0200
+@@ -983,10 +983,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)
+Index: mutt-1.5.19/sendlib.c
+===================================================================
+--- mutt-1.5.19.orig/sendlib.c	2009-01-04 00:27:11.000000000 +0100
++++ mutt-1.5.19/sendlib.c	2009-05-28 18:06:04.884222505 +0200
+@@ -1741,7 +1741,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;
+@@ -1784,7 +1784,7 @@
+   else if (mode > 0)
+     fputs ("Cc: \n", fp);
+ 
+-  if (env->bcc)
++  if (env->bcc && should_write_bcc)
+   {
+     if(mode != 0 || option(OPTWRITEBCC))
+     {
+@@ -2507,7 +2507,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-
diff --git a/debian/patches/series b/debian/patches/series
index 3148736..0646964 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -42,3 +42,4 @@ mutt-patched/sidebar-compat-apply.debian
 # not-applied/chdir
 # not-applied/indexcolor
 # not-applied/w3mface
+debian-specific/write_bcc
diff --git a/debian/patches/debian-specific/Muttrc b/debian/patches/debian-specific/Muttrc
index 88a08d7..220faa1 100644
--- a/debian/patches/debian-specific/Muttrc
+++ b/debian/patches/debian-specific/Muttrc
@@ -1,6 +1,8 @@
---- a/doc/Muttrc.head
-+++ b/doc/Muttrc.head
-@@ -6,6 +6,36 @@
+Index: clean/doc/Muttrc.head
+===================================================================
+--- clean.orig/doc/Muttrc.head	2009-05-28 16:53:42.507905895 +0200
++++ clean/doc/Muttrc.head	2009-05-28 17:04:46.238928891 +0200
+@@ -6,6 +6,35 @@
  #
  ignore "from " received content- mime-version status x-status message-id
  ignore sender references return-path lines
@@ -24,9 +26,8 @@
 +# Specifies how to sort messages in the index menu.
 +set sort=threads
 +
-+# Uncomment if your MTA does not strip Bcc: headers.
-+# (exim4 and postfix strip them, exim(3) does not.)
-+#unset write_bcc
++# Do not write out Bcc headers
++unset write_bcc
 +# Postfix and qmail use Delivered-To for detecting loops
 +unset bounce_delivered
 +
@@ -37,7 +38,7 @@
  
  # imitate the old search-body function
  macro index \eb "<search>~b " "search in message bodies"
-@@ -18,7 +48,7 @@ macro index,pager,attach,compose \cb "\
+@@ -18,7 +47,7 @@
  "call urlview to extract URLs out of a message"
  
  # Show documentation when pressing F1
@@ -46,7 +47,7 @@
  
  # show the incoming mailboxes list (just like "mutt -y") and back when pressing "y"
  macro index,pager y "<change-folder>?<toggle-mailboxes>" "show incoming mailboxes list"
-@@ -30,7 +60,7 @@ bind browser y exit
+@@ -30,7 +59,7 @@
  # append-hook \\.gz$ "gzip -c %t >> %f"
  
  # If Mutt is unable to determine your site's domain name correctly, you can
@@ -55,7 +56,7 @@
  #
  # set hostname=cs.hmc.edu
  
-@@ -92,6 +122,9 @@ attachments   +I text/plain
+@@ -92,6 +121,9 @@
  attachments   -A message/external-body
  attachments   -I message/external-body
  
diff --git a/debian/patches/debian-specific/document_debian_defaults b/debian/patches/debian-specific/document_debian_defaults
index ea8310a..d632bad 100644
--- a/debian/patches/debian-specific/document_debian_defaults
+++ b/debian/patches/debian-specific/document_debian_defaults
@@ -1,6 +1,8 @@
---- a/init.h
-+++ b/init.h
-@@ -295,6 +295,9 @@ struct option_t MuttVars[] = {
+Index: clean/init.h
+===================================================================
+--- clean.orig/init.h	2009-05-28 16:53:44.420791638 +0200
++++ clean/init.h	2009-05-28 17:02:15.435773870 +0200
+@@ -295,6 +295,9 @@
    ** .pp
    ** When this variable is set, mutt will include Delivered-To headers when
    ** bouncing messages.  Postfix users may wish to unset this variable.
@@ -10,7 +12,7 @@
    */
    { "braille_friendly", DT_BOOL, R_NONE, OPTBRAILLEFRIENDLY, 0 },
    /*
-@@ -825,6 +828,9 @@ struct option_t MuttVars[] = {
+@@ -828,6 +831,9 @@
    ** one is not used.
    ** .pp
    ** Also see ``$$use_domain'' and ``$$hidden_host''.
@@ -20,7 +22,7 @@
    */
    { "ignore_linear_white_space",    DT_BOOL, R_NONE, OPTIGNORELWS, 0 },
    /*
-@@ -1338,6 +1344,9 @@ struct option_t MuttVars[] = {
+@@ -1341,6 +1347,9 @@
    ** system.  It is used with various sets of parameters to gather the
    ** list of known remailers, and to finally send a message through the
    ** mixmaster chain.
@@ -30,7 +32,7 @@
    */
  #endif
  
-@@ -1887,6 +1896,10 @@ struct option_t MuttVars[] = {
+@@ -1890,6 +1899,10 @@
    ** This variable contains the name of either a directory, or a file which
    ** contains trusted certificates for use with OpenSSL.
    ** (S/MIME only)
@@ -41,7 +43,7 @@
    */
    { "smime_certificates",	DT_PATH, R_NONE, UL &SmimeCertificates, 0 },
    /*
-@@ -2093,6 +2106,9 @@ struct option_t MuttVars[] = {
+@@ -2096,6 +2109,9 @@
    ** certificates are also automatically accepted.
    ** .pp
    ** Example: set ssl_ca_certificates_file=/etc/ssl/certs/ca-certificates.crt
@@ -51,7 +53,7 @@
    */
  # endif /* USE_SSL_GNUTLS */
  #endif /* defined(USE_SSL) */
-@@ -2683,6 +2699,9 @@ struct option_t MuttVars[] = {
+@@ -2708,6 +2724,9 @@
    ** .pp
    ** You may optionally use the reverse- prefix to specify reverse sorting
    ** order (example: set sort=reverse-date-sent).
@@ -61,13 +63,3 @@
    */
    { "sort_alias",	DT_SORT|DT_SORT_ALIAS,	R_NONE,	UL &SortAlias, SORT_ALIAS },
    /*
-@@ -3100,6 +3119,9 @@ struct option_t MuttVars[] = {
-   ** 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.
-   */
-   {"xterm_icon",       DT_STR,   R_BOTH, UL &XtermIcon,  UL "M%?n?AIL&ail?"},
-   /*
diff --git a/debian/patches/debian-specific/write_bcc b/debian/patches/debian-specific/write_bcc
new file mode 100644
index 0000000..9738c87
--- /dev/null
+++ b/debian/patches/debian-specific/write_bcc
@@ -0,0 +1,93 @@
+Index: clean/headers.c
+===================================================================
+--- clean.orig/headers.c	2009-05-28 17:05:20.621600577 +0200
++++ clean/headers.c	2009-05-28 17:05:27.813399361 +0200
+@@ -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. */
+Index: clean/init.h
+===================================================================
+--- clean.orig/init.h	2009-05-28 17:05:20.827782111 +0200
++++ clean/init.h	2009-05-28 17:05:27.833443376 +0200
+@@ -3158,11 +3158,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.
++  ** 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.
+   */
+   {"xterm_icon",       DT_STR,   R_BOTH, UL &XtermIcon,  UL "M%?n?AIL&ail?"},
+   /*
+Index: clean/protos.h
+===================================================================
+--- clean.orig/protos.h	2009-05-28 17:05:21.150107179 +0200
++++ clean/protos.h	2009-05-28 17:05:27.841467411 +0200
+@@ -370,7 +370,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 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: clean/send.c
+===================================================================
+--- clean.orig/send.c	2009-05-28 17:05:21.359893218 +0200
++++ clean/send.c	2009-05-28 17:05:27.849492903 +0200
+@@ -984,10 +984,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)
+Index: clean/sendlib.c
+===================================================================
+--- clean.orig/sendlib.c	2009-05-28 17:05:21.569320574 +0200
++++ clean/sendlib.c	2009-05-28 17:05:27.857520497 +0200
+@@ -1743,7 +1743,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;
+@@ -1786,7 +1786,7 @@
+   else if (mode > 0)
+     fputs ("Cc: \n", fp);
+ 
+-  if (env->bcc)
++  if (env->bcc && should_write_bcc)
+   {
+     if(mode != 0 || option(OPTWRITEBCC))
+     {
+@@ -2559,7 +2559,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-
diff --git a/debian/patches/series b/debian/patches/series
index f48776b..364858b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -41,3 +41,4 @@ mutt-patched/sidebar-compat-apply.debian
 # not-applied/chdir
 # not-applied/indexcolor
 # not-applied/w3mface
+debian-specific/write_bcc

Reply to: