mirror of
https://github.com/mjl-/mox.git
synced 2025-07-19 03:26:37 +03:00
implement imap savedate extension, rfc 8514
it makes a new field available on stored messages. not when they they were received (over smtp) or appended to the mailbox (over imap), but when they were last "saved" in the mailbox. copy/move of a message (eg to the trash) resets the "savedate" value. this helps implement "remove messages from trash after X days".
This commit is contained in:
@ -404,6 +404,17 @@ func (cmd *fetchCmd) xprocessAtt(a fetchAtt) []token {
|
||||
m := cmd.xensureMessage()
|
||||
return []token{bare("INTERNALDATE"), dquote(m.Received.Format("_2-Jan-2006 15:04:05 -0700"))}
|
||||
|
||||
case "SAVEDATE":
|
||||
m := cmd.xensureMessage()
|
||||
// For messages in storage from before we implemented this extension, we don't have
|
||||
// a savedate, and we return nil. This is normally meant to be per mailbox, but
|
||||
// returning it per message should be fine. ../rfc/8514:191
|
||||
var savedate token = nilt
|
||||
if m.SaveDate != nil {
|
||||
savedate = dquote(m.SaveDate.Format("_2-Jan-2006 15:04:05 -0700"))
|
||||
}
|
||||
return []token{bare("SAVEDATE"), savedate}
|
||||
|
||||
case "BODYSTRUCTURE":
|
||||
_, part := cmd.xensureParsed()
|
||||
bs := xbodystructure(part, true)
|
||||
|
Reference in New Issue
Block a user