diff --git a/imap/handlers/fetch.cpp b/imap/handlers/fetch.cpp index 4034589..2c74a89 100644 --- a/imap/handlers/fetch.cpp +++ b/imap/handlers/fetch.cpp @@ -1352,41 +1352,22 @@ EString Fetch::bodyStructure( Multipart * m, bool extended ) log( "Fetch::bodyStructure - plain", Log::Debug ); } if ( ct ) - log( "Fetch::bodyStructure - ct: " + ct->type(), Log::Debug ); + log( "Fetch::bodyStructure - ct: " + ct->type() + "/" + ct->subtype(), Log::Debug ); if ( ct && ct->type() == "multipart" ) { - if ( ct->subtype() == "signed" ) { - log( "Fetch::bodyStructure - have multipart/signed", Log::Debug ); - inMultipartSigned = true; - } EStringList children; List< Bodypart >::Iterator it( m->children() ); while ( it ) { - if ( inMultipartSigned ) { - log( "Fetch::bodyStructure - multipart/signed, skipping part 1", Log::Debug ); - Header * h = it->header(); - if ( h ) { - ContentType * cty = h->contentType(); - if ( cty ) { - log( "Fetch::bodyStructure - skipping ct:" + cty->type() + - "/" + cty->subtype(), Log::Debug ); - } else { - log( "Fetch::bodyStructure - skipping part w/o ct", Log::Debug ); - } - } else { - log( "Fetch::bodyStructure - skipping part w/o header", Log::Debug ); - } - ++it; // skip next child-structure, as we appended it already raw - inMultipartSigned = false; - if ( !it ) break; - } Header * h = it->header(); if ( h ) { ContentType * cty = h->contentType(); - if ( cty ) { - log( "Fetch::bodyStructure - append child, ct:" + cty->type() + - "/" + cty->subtype(), Log::Debug ); + if ( !extended && + ( cty && cty->type() == "multipart" && cty->subtype() == "signed" ) ) { + log( "Fetch::bodyStructure - multipart/signed, skipping next part", Log::Debug ); + ++it; // skip next child-structure, as we appended it already raw + if ( !it ) break; } else { - log( "Fetch::bodyStructure - append child", Log::Debug );
diff --git a/message/multipart.cpp b/message/multipart.cpp index 312ce77..d2bed06 100644 --- a/message/multipart.cpp +++ b/message/multipart.cpp @@ -105,7 +105,17 @@ void Multipart::appendMultipart( EString &r, bool avoidUtf8, bool isPgpSigned )
Bodypart * bp = it; ++it; - + Header * h = it->header(); + if ( h ) { + ContentType * cty = h->contentType(); + if ( cty && cty->type() == "multipart" && cty->subtype() == "signed" ) { + // isSigned = true; + ::log("Multipart::appendMultipart (loop) - ct:" + cty->type() + + "/" + cty->subtype(), Log::Debug ); + } + } else { + ::log("Multipart::appendMultipart (loop) - no header", Log::Debug ); + } if ( isSigned ) { if ( isPgpSigned ) ::log( "**** Multipart::appendMultipart - deep in signed part", Log::Debug ); @@ -115,6 +125,7 @@ void Multipart::appendMultipart( EString &r, bool avoidUtf8, bool isPgpSigned ) // we do not want our simple header, just append our raw text appendAnyPart( r, bp, ct, avoidUtf8, true ); ::log( "**** Multipart::appendMultipart - signed, raw(?) text was appended", Log::Debug ); + //break; isSigned = false; } else { r.append( bp->header()->asText( avoidUtf8 ) );
--- PGP-Key:29E99DD6 ☀ +49 160 9945 7889 ☀ computing @ chaos claudius