summaryrefslogtreecommitdiffstats
path: root/copy.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-08-15 11:43:03 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-08-15 11:43:03 +0000
commitd4c913f7f5de8675216d21975a49b61342600e26 (patch)
treebfff33169d7a683640b8b9bcc26827e37eb810c8 /copy.c
parentd0051659a6b712c4fffa8656fe1cb1fe3927e1aa (diff)
Various changes added over the last week:
- $delete_untag - creation of "application/pgp" messages - an attempt to fix prepare. - Browser format changes
Diffstat (limited to 'copy.c')
-rw-r--r--copy.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/copy.c b/copy.c
index fe6b35aa..c6b60925 100644
--- a/copy.c
+++ b/copy.c
@@ -45,6 +45,7 @@ mutt_copy_hdr (FILE *in, FILE *out, long off_start, long off_end, int flags,
const char *prefix)
{
int from = 0;
+ int this_is_from;
int ignore = 0;
char buf[STRING]; /* should be long enough to get most fields in one pass */
char *nl;
@@ -136,16 +137,19 @@ mutt_copy_hdr (FILE *in, FILE *out, long off_start, long off_end, int flags,
if (nl && buf[0] != ' ' && buf[0] != '\t')
{
ignore = 1;
+ this_is_from = 0;
if (!from && mutt_strncmp ("From ", buf, 5) == 0)
{
if ((flags & CH_FROM) == 0)
continue;
- from = 1;
+ this_is_from = from = 1;
}
else if (buf[0] == '\n' || (buf[0] == '\r' && buf[1] == '\n'))
break; /* end of header */
- if ((flags & CH_WEED) &&
+ /* note: CH_FROM takes precedence over header weeding. */
+ if (!((flags & CH_FROM) && (flags & CH_FORCE_FROM) && this_is_from) &&
+ (flags & CH_WEED) &&
mutt_matches_ignore (buf, Ignore) &&
!mutt_matches_ignore (buf, UnIgnore))
continue;
@@ -262,6 +266,7 @@ mutt_copy_hdr (FILE *in, FILE *out, long off_start, long off_end, int flags,
/* flags
CH_DECODE RFC2047 header decoding
CH_FROM retain the "From " message separator
+ CH_FORCE_FROM give CH_FROM precedence over CH_WEED
CH_MIME ignore MIME fields
CH_NOLEN don't write Content-Length: and Lines:
CH_NONEWLINE don't output a newline after the header
@@ -606,7 +611,7 @@ _mutt_append_message (CONTEXT *dest, FILE *fpin, CONTEXT *src, HEADER *hdr,
if ((msg = mx_open_new_message (dest, hdr, (src->magic == M_MBOX || src->magic == M_MMDF || src->magic == M_KENDRA) ? 0 : M_ADD_FROM)) == NULL)
return -1;
if (dest->magic == M_MBOX || dest->magic == M_MMDF || dest->magic == M_KENDRA)
- chflags |= CH_FROM;
+ chflags |= CH_FROM | CH_FORCE_FROM;
chflags |= (dest->magic == M_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
r = _mutt_copy_message (msg->fp, fpin, hdr, body, flags, chflags);
if (mx_commit_message (msg, dest) != 0)