github.com/jordwest/imap-server@v0.0.0-20200627020849-1cf758ba359f/conn/thunderbird_test.go (about) 1 package conn_test 2 3 import . "github.com/onsi/ginkgo" 4 5 var _ = Describe("Thunderbird mail client", func() { 6 Context("v31.7.0/OSX", func() { 7 It("should download messages, mark a message as seen and then flagged", func() { 8 ExpectResponse("* OK IMAP4rev1 Service Ready") 9 SendLine("1 capability") 10 ExpectResponse("* CAPABILITY IMAP4rev1 AUTH=PLAIN") 11 ExpectResponse("1 OK CAPABILITY completed") 12 SendLine("2 authenticate plain") 13 ExpectResponse("+") 14 SendBase64("\x00username\x00password") 15 SendLine("") 16 ExpectResponse("2 OK Authenticated") 17 SendLine("3 select \"INBOX\"") 18 ExpectResponse("* 3 EXISTS") 19 ExpectResponse("* 3 RECENT") 20 ExpectResponse("* OK [UNSEEN 3]") 21 ExpectResponse("* OK [UIDNEXT 13]") 22 ExpectResponse("* OK [UIDVALIDITY 250]") 23 ExpectResponse("* FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)") 24 ExpectResponse("3 OK [READ-WRITE] SELECT completed") 25 SendLine("4 UID fetch 1:* (FLAGS)") 26 ExpectResponse("* 1 FETCH (FLAGS (\\Recent) UID 10)") 27 ExpectResponse("* 2 FETCH (FLAGS (\\Recent) UID 11)") 28 ExpectResponse("* 3 FETCH (FLAGS (\\Recent) UID 12)") 29 ExpectResponse("4 OK UID FETCH Completed") 30 SendLine("5 noop") 31 ExpectResponse("5 OK NOOP Completed") 32 SendLine("6 UID fetch 13:* (FLAGS)") 33 ExpectResponse("6 OK UID FETCH Completed") 34 SendLine("7 uid store 12 +Flags (\\Seen)") 35 ExpectResponse("* 3 FETCH (FLAGS (\\Seen))") 36 ExpectResponse("7 OK STORE Completed") 37 SendLine("8 uid store 12 +Flags (\\Flagged)") 38 ExpectResponse("* 3 FETCH (FLAGS (\\Seen \\Flagged))") 39 ExpectResponse("8 OK STORE Completed") 40 }) 41 }) 42 })