summaryrefslogtreecommitdiffstats
path: root/handler.c
diff options
context:
space:
mode:
authorBrendan Cully <brendan@kublai.com>2008-06-24 23:12:02 -0700
committerBrendan Cully <brendan@kublai.com>2008-06-24 23:12:02 -0700
commit5fbc0df492ab5ec7003a005ec8f5b3d5ddfaddd7 (patch)
tree8f87ddf6be2c097d15ceb79469d0e84d110217c2 /handler.c
parentc0d725248d4aca079c86c90abced1c22743d18b3 (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.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/handler.c b/handler.c
index d2ad7112..279f38a8 100644
--- a/handler.c
+++ b/handler.c
@@ -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)
{