summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--copy.c5
-rw-r--r--doc/manual.sgml.in9
-rw-r--r--init.h1
-rw-r--r--mutt.h2
-rw-r--r--sendlib.c8
5 files changed, 22 insertions, 3 deletions
diff --git a/copy.c b/copy.c
index 79b36594..369980b3 100644
--- a/copy.c
+++ b/copy.c
@@ -60,7 +60,7 @@ mutt_copy_hdr (FILE *in, FILE *out, long off_start, long off_end, int flags,
buf[0] = '\n';
buf[1] = 0;
- if ((flags & (CH_REORDER | CH_WEED | CH_MIME | CH_DECODE | CH_PREFIX)) == 0)
+ if ((flags & (CH_REORDER | CH_WEED | CH_MIME | CH_DECODE | CH_PREFIX | CH_WEED_DELIVERED)) == 0)
{
/* Without these flags to complicate things
* we can do a more efficient line to line copying
@@ -149,6 +149,9 @@ mutt_copy_hdr (FILE *in, FILE *out, long off_start, long off_end, int flags,
mutt_matches_ignore (buf, Ignore) &&
!mutt_matches_ignore (buf, UnIgnore))
continue;
+ if ((flags & CH_WEED_DELIVERED) &&
+ mutt_strncasecmp ("Delivered-To:", buf, 13) == 0)
+ continue;
if ((flags & (CH_UPDATE | CH_XMIT | CH_NOSTATUS)) &&
(mutt_strncasecmp ("Status:", buf, 7) == 0 ||
mutt_strncasecmp ("X-Status:", buf, 9) == 0))
diff --git a/doc/manual.sgml.in b/doc/manual.sgml.in
index 08601669..9f2cd204 100644
--- a/doc/manual.sgml.in
+++ b/doc/manual.sgml.in
@@ -2608,6 +2608,15 @@ When this variable is set, mutt will beep whenever it prints a
message notifying you of new mail. This is independent of the
setting of the <ref id="beep" name="beep"> variable.
+<sect2>bounce&lowbar;delivered<label id="bounce_delivered">
+<p>
+Type boolean<newline>
+Default: set
+
+When this variable is set, mutt will include Delivered-To headers
+when bouncing messages. Postfix users may wish to unset this
+variable.
+
<sect2>charset<label id="charset">
<p>
Type: string<newline>
diff --git a/init.h b/init.h
index 65d9af92..f40904b7 100644
--- a/init.h
+++ b/init.h
@@ -85,6 +85,7 @@ struct option_t MuttVars[] = {
{ "auto_tag", DT_BOOL, R_NONE, OPTAUTOTAG, 0 },
{ "beep", DT_BOOL, R_NONE, OPTBEEP, 1 },
{ "beep_new", DT_BOOL, R_NONE, OPTBEEPNEW, 0 },
+ { "bounce_delivered", DT_BOOL, R_NONE, OPTBOUNCEDELIVERED, 1 },
{ "charset", DT_STR, R_NONE, UL &Charset, UL "iso-8859-1" },
{ "check_new", DT_BOOL, R_NONE, OPTCHECKNEW, 1 },
{ "collapse_unread", DT_BOOL, R_NONE, OPTCOLLAPSEUNREAD, 1 },
diff --git a/mutt.h b/mutt.h
index a4bd8127..4e704fd1 100644
--- a/mutt.h
+++ b/mutt.h
@@ -86,6 +86,7 @@
#define CH_UPDATE_LEN (1<<10) /* update Lines: and Content-Length: */
#define CH_TXTPLAIN (1<<11) /* generate text/plain MIME headers */
#define CH_NOLEN (1<<12) /* don't write Content-Length: and Lines: */
+#define CH_WEED_DELIVERED (1<<13) /* weed eventual Delivered-To headers */
/* flags for mutt_enter_string() */
#define M_ALIAS 1 /* do alias "completion" by calling up the alias-menu */
@@ -289,6 +290,7 @@ enum
OPTAUTOTAG,
OPTBEEP,
OPTBEEPNEW,
+ OPTBOUNCEDELIVERED,
OPTCHECKNEW,
OPTCOLLAPSEUNREAD,
OPTCONFIRMAPPEND,
diff --git a/sendlib.c b/sendlib.c
index f263f4b2..b5c61a35 100644
--- a/sendlib.c
+++ b/sendlib.c
@@ -1821,9 +1821,13 @@ void mutt_bounce_message (HEADER *h, ADDRESS *to)
if ((f = safe_fopen (tempfile, "w")) != NULL)
{
const char *fqdn;
-
+ int ch_flags = CH_XMIT | CH_NONEWLINE;
+
+ if (!option (OPTBOUNCEDELIVERED))
+ ch_flags |= CH_WEED_DELIVERED;
+
fseek (msg->fp, h->offset, 0);
- mutt_copy_header (msg->fp, h, f, CH_XMIT | CH_NONEWLINE, NULL);
+ mutt_copy_header (msg->fp, h, f, ch_flags, NULL);
fprintf (f, "Resent-From: %s", NONULL(Username));
if((fqdn = mutt_fqdn(1)))
fprintf (f, "@%s", fqdn);