diff options
author | Brendan Cully <brendan@kublai.com> | 2008-06-24 23:12:02 -0700 |
---|---|---|
committer | Brendan Cully <brendan@kublai.com> | 2008-06-24 23:12:02 -0700 |
commit | 5fbc0df492ab5ec7003a005ec8f5b3d5ddfaddd7 (patch) | |
tree | 8f87ddf6be2c097d15ceb79469d0e84d110217c2 /handler.c | |
parent | c0d725248d4aca079c86c90abced1c22743d18b3 (diff) |
Make multipart decoding a little more forgiving.
First, ignore bad content-transfer-encoding in multipart sections.
Second, if an attachment fails to decode, print a warning and continue
instead of giving up on the entire message.
Diffstat (limited to 'handler.c')
-rw-r--r-- | handler.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -1199,11 +1199,12 @@ int multipart_handler (BODY *a, STATE *s) if (rc) { + mutt_error ("One or more parts of this message could not be displayed"); dprint (1, (debugfile, "Failed on attachment #%d, type %s/%s.\n", count, TYPE(p), NONULL (p->subtype))); } - if (rc || ((s->flags & M_REPLYING) - && (option (OPTINCLUDEONLYFIRST)) && (s->flags & M_FIRSTDONE))) + if ((s->flags & M_REPLYING) + && (option (OPTINCLUDEONLYFIRST)) && (s->flags & M_FIRSTDONE)) break; } @@ -1564,6 +1565,14 @@ int mutt_body_handler (BODY *b, STATE *s) if (!handler) handler = multipart_handler; + + if (b->encoding != ENC7BIT && b->encoding != ENC8BIT + && b->encoding != ENCBINARY) + { + dprint (1, (debugfile, "Bad encoding type %d for multipart entity, " + "assuming 7 bit\n", b->encoding)); + b->encoding = ENC7BIT; + } } else if (WithCrypto && b->type == TYPEAPPLICATION) { |