Replace old INTERNALDATE

This commit is contained in:
Michal Horejsek
2021-01-06 10:31:45 +01:00
committed by Jakub Cuth
parent a2cf1b6022
commit 1839f072b4
2 changed files with 7 additions and 3 deletions

View File

@ -229,6 +229,12 @@ func (im *imapMailbox) getMessage(storeMessage storeMessageProvider, items []ima
}
case imap.FetchInternalDate:
msg.InternalDate = time.Unix(m.Time, 0)
// Apple Mail crashes fetching messages with date older than 1970.
// There is no point having message older than RFC itself, it's not possible.
if msg.InternalDate.Before(rfc822Birthday) {
msg.InternalDate = rfc822Birthday
}
case imap.FetchRFC822Size:
// Size attribute on the server counts encrypted data. The value is cleared
// on our part and we need to compute "real" size of decrypted data.