From 5256f6122e9843b1e9988a742ed6c2a4923bc2bd Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Thu, 16 Jun 2011 21:44:42 +0200 Subject: mimedecode: Fix multipart/mixed detection. Fixes a regression introduced in release 5.0.0 in March 1999 that was attributed to Henrik Storner. (cherry-pick from master, e45e718a80379391f8ba457e64e19f75f061741a) --- NEWS | 4 ++++ unmime.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index e53c32b2..c9c65a1b 100644 --- a/NEWS +++ b/NEWS @@ -171,6 +171,10 @@ fetchmail-6.4.0 (not yet released): Fixes Debian Bug#928916, reported by Paul Kimoto. * fetchmailconf would ignore Edit or Delete actions on the first (topmost) item in a list (no matter if server list, user list, ...). +* The mimedecode feature now properly detects multipart/mixed-type matches, so + that quoted-printable-encoded multipart messages can get decoded. + (Regression in 5.0.0 on 1999-03-27, as a side effect of a PGP-mimedecode fix + attributed to Henrik Storner.) ## UPDATED TRANSLATIONS - THANKS TO: * CS: Petr Pisar [Czech] diff --git a/unmime.c b/unmime.c index f799ff92..5f743e36 100644 --- a/unmime.c +++ b/unmime.c @@ -459,7 +459,7 @@ int MimeBodyType(char *hdrs, int WantDecode) /* Check Content-Type to see if this is a multipart message */ if ( (CntType != NULL) && - ((strncasecmp(CntType, "multipart/mixed", 16) == 0) || + ((strncasecmp(CntType, "multipart/mixed", 15) == 0) || (strncasecmp(CntType, "message/", 8) == 0)) ) { char *p1 = GetBoundary(CntType); @@ -469,7 +469,6 @@ int MimeBodyType(char *hdrs, int WantDecode) the boundary string */ strcpy(MultipartDelimiter, "--"); strlcat(MultipartDelimiter, p1, sizeof(MultipartDelimiter)); - MultipartDelimiter[sizeof(MultipartDelimiter)-1] = '\0'; BodyType = (MSG_IS_8BIT | MSG_NEEDS_DECODE); } } -- cgit v1.2.3