diff --git a/src/vmime/messageParser.cpp b/src/vmime/messageParser.cpp index 21ac09bb..4f53b5d0 100644 --- a/src/vmime/messageParser.cpp +++ b/src/vmime/messageParser.cpp @@ -82,12 +82,18 @@ void messageParser::parse(const shared_ptr & msg) { // Date shared_ptr recv = msg->getHeader()->findField(fields::RECEIVED); + static const datetime unsetDate; + + m_date = unsetDate; if (recv) { m_date = recv->getValue ()->getDate(); - } else { + } + + // RECEIVED may in some cases contain no date at all + if (unsetDate == m_date) { shared_ptr date = msg->getHeader()->findField(fields::DATE);