diff options
author | Jacek Piszczek <[email protected]> | 2021-03-16 00:31:07 +0000 |
---|---|---|
committer | Jacek Piszczek <[email protected]> | 2021-03-16 00:31:07 +0000 |
commit | 408ffb13ea5de88e96b1e115a258125e5d4e1563 (patch) | |
tree | b47468a4f6d8d96328cb7b3f3d8414b0fe009929 /src | |
parent | #250 Fixed unquoted mailbox name (diff) | |
download | vmime-408ffb13ea5de88e96b1e115a258125e5d4e1563.tar.gz vmime-408ffb13ea5de88e96b1e115a258125e5d4e1563.zip |
Default missing Content-Type to Text/Plain as per https://tools.ietf.org/html/rfc2045#section-5.2
Diffstat (limited to 'src')
-rw-r--r-- | src/vmime/messageParser.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/vmime/messageParser.cpp b/src/vmime/messageParser.cpp index 21ac09bb..b46d3237 100644 --- a/src/vmime/messageParser.cpp +++ b/src/vmime/messageParser.cpp @@ -204,7 +204,16 @@ bool messageParser::findSubTextParts( } else { - // No "Content-type" field. + // No "Content-type" field. RFC2045 section 5.2 assumes this is TEXT/PLAIN + try { + shared_ptr <textPart> txtPart = textPartFactory::getInstance()->create(mediaType(mediaTypes::TEXT, mediaTypes::TEXT_PLAIN)); + txtPart->parse(msg, part, p); + + m_textParts.push_back(txtPart); + } + catch (exceptions::no_factory_available& e) { + // Content-type not recognized. + } } } |