diff options
author | Brendan Cully <brendan@kublai.com> | 2005-07-24 08:59:44 +0000 |
---|---|---|
committer | Brendan Cully <brendan@kublai.com> | 2005-07-24 08:59:44 +0000 |
commit | fe33d1e8ab61b21eeb0d899be818dec166db1f60 (patch) | |
tree | a4165331ee4d17241b9a7a24fef079ed0d87b90b /copy.c | |
parent | b12887933ec039dd86759ba61b33df90381ae35d (diff) |
Don't assume messages in MMDF mailboxes have From separators when copying them.
Spotted by William Lovas. Initial patch by TAKAHASHI Tamotsu.
Diffstat (limited to 'copy.c')
-rw-r--r-- | copy.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -701,10 +701,15 @@ int _mutt_append_message (CONTEXT *dest, FILE *fpin, CONTEXT *src, HEADER *hdr, BODY *body, int flags, int chflags) { + char buf[STRING]; MESSAGE *msg; int r; - if ((msg = mx_open_new_message (dest, hdr, (src->magic == M_MBOX || src->magic == M_MMDF) ? 0 : M_ADD_FROM)) == NULL) + fseek(fpin, hdr->offset, 0); + if (fgets (buf, sizeof (buf), fpin) == NULL) + return -1; + + if ((msg = mx_open_new_message (dest, hdr, is_from (buf, NULL, 0, NULL) ? 0 : M_ADD_FROM)) == NULL) return -1; if (dest->magic == M_MBOX || dest->magic == M_MMDF) chflags |= CH_FROM | CH_FORCE_FROM; |