]> granicus.if.org Git - neomutt/commitdiff
Add $bounce_delivered.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 15 Mar 1999 15:32:15 +0000 (15:32 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 15 Mar 1999 15:32:15 +0000 (15:32 +0000)
copy.c
doc/manual.sgml.in
init.h
mutt.h
sendlib.c

diff --git a/copy.c b/copy.c
index 79b365946a182735bafce60dfc4efdbc286d5904..369980b3b92f5288ef39222a0fcd914fc2a8898c 100644 (file)
--- 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))
index 08601669ca08c0fab32ef5497118f29e0c73429c..9f2cd20478e3a5b77ddf4a01043728cf9b159d53 100644 (file)
@@ -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 65d9af92fdd6e611a0be93b255e07333db865750..f40904b7f9ad6a7aef08aa36517e922eddebc8f9 100644 (file)
--- 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 a4bd81276a97283a0479b4e9a3a4bae33740aed8..4e704fd1e8cb87252c65693b62d27e0dabb47106 100644 (file)
--- 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,
index f263f4b245b2e3a428152f5ca14a2b7a2d8b3ba8..b5c61a3521225ed6c061a3e6052032a99d8573fe 100644 (file)
--- 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);