Merge pull request #254 from jacadcaps/MessageParserDate

Workaround a RECEIVED message field missing actual date info.
This commit is contained in:
Vincent Richard 2021-03-16 21:36:25 +01:00 committed by GitHub
commit cb5adc3a23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,12 +82,18 @@ void messageParser::parse(const shared_ptr <const message>& msg) {
// Date
shared_ptr <const headerField> recv = msg->getHeader()->findField(fields::RECEIVED);
static const datetime unsetDate;
m_date = unsetDate;
if (recv) {
m_date = recv->getValue <relay>()->getDate();
} else {
}
// RECEIVED may in some cases contain no date at all
if (unsetDate == m_date) {
shared_ptr <const headerField> date = msg->getHeader()->findField(fields::DATE);