[Fix]: Fix expiry timer logic

This commit is contained in:
ClaraCrazy 2025-12-27 21:49:09 +01:00
parent 7ac2ef7b76
commit 54822dad6f
No known key found for this signature in database
GPG key ID: EBBC896ACB497011

View file

@ -344,7 +344,14 @@ class ImapService extends EventEmitter {
} catch { } catch {
// Do nothing // Do nothing
} }
const date = headerPart.date[0] const rawDate = headerPart.date && headerPart.date[0] ? headerPart.date[0] : undefined
let date
if (rawDate) {
const m = moment.parseZone(rawDate)
date = m.toDate()
} else {
date = new Date()
}
const { uid } = message.attributes const { uid } = message.attributes
return Mail.create(to, from, date, subject, uid) return Mail.create(to, from, date, subject, uid)