File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -688,7 +688,10 @@ func (c *Conn) xmsgatt1() FetchAttr {
688
688
689
689
case "INTERNALDATE" :
690
690
c .xspace ()
691
- return FetchInternalDate (c .xquoted ()) // todo: parsed time
691
+ s := c .xquoted ()
692
+ v , err := time .Parse ("_2-Jan-2006 15:04:05 -0700" , s )
693
+ c .xcheckf (err , "parsing internaldate" )
694
+ return FetchInternalDate {v }
692
695
693
696
case "SAVEDATE" :
694
697
c .xspace ()
Original file line number Diff line number Diff line change @@ -455,7 +455,10 @@ type Address struct {
455
455
}
456
456
457
457
// "INTERNALDATE" fetch response.
458
- type FetchInternalDate string // todo: parsed time
458
+ type FetchInternalDate struct {
459
+ Date time.Time
460
+ }
461
+
459
462
func (f FetchInternalDate ) Attr () string { return "INTERNALDATE" }
460
463
461
464
// "SAVEDATE" fetch response. ../rfc/8514:265
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ func TestFetch(t *testing.T) {
23
23
tc .client .Select ("inbox" )
24
24
25
25
uid1 := imapclient .FetchUID (1 )
26
- date1 := imapclient .FetchInternalDate ( "16-Nov-2022 10:01:00 +0100" )
26
+ date1 := imapclient.FetchInternalDate { received }
27
27
rfcsize1 := imapclient .FetchRFC822Size (len (exampleMsg ))
28
28
env1 := imapclient.FetchEnvelope {
29
29
Date : "Mon, 7 Feb 1994 21:52:25 -0800" ,
You can’t perform that action at this time.
0 commit comments