imapclient: parse fetch attribute "internaldate" as time.Time instead of keeping it as string

similar to the SAVEDATE fetch attribute implemented recently.
This commit is contained in:
Mechiel Lukkien
2025-02-19 23:01:23 +01:00
parent 02c4715724
commit 6ed97469b7
3 changed files with 9 additions and 3 deletions

View File

@ -688,7 +688,10 @@ func (c *Conn) xmsgatt1() FetchAttr {
case "INTERNALDATE":
c.xspace()
return FetchInternalDate(c.xquoted()) // todo: parsed time
s := c.xquoted()
v, err := time.Parse("_2-Jan-2006 15:04:05 -0700", s)
c.xcheckf(err, "parsing internaldate")
return FetchInternalDate{v}
case "SAVEDATE":
c.xspace()