mxk / go-imap

IMAP4rev1 Client for Go
BSD 3-Clause "New" or "Revised" License
212 stars 63 forks source link

Changes needed so I can use your go-imap for imap2json #3

Closed kaihendry closed 10 years ago

kaihendry commented 10 years ago

https://github.com/kaihendry/imap2json

Many thanks,

mxk commented 10 years ago

RFC 5256 needs to be either implemented fully or handled outside of the package if you just need the UID THREAD command. Client.CommandConfig is exposed specifically so that you can make changes to the list of known commands.

For anonymous SASL authentication you should use the Auth method. Did you run into any problems with it?

kaihendry commented 10 years ago

I just want the response of the UID THREAD, as I parse it in https://github.com/kaihendry/imap2json/blob/master/imap2json.go#L49 which is probably a terrible way to do it.

Can you give me an example of using Client.CommandConfig ?

Can you also give me a further clue with the Auth method so I not use my silly patch?

Thank you!

mxk commented 10 years ago
c.CommandConfig["UID THREAD"] = &imap.CommandConfig{
    States: imap.Login | imap.Auth | imap.Selected | imap.Logout,
    Filter: imap.NameFilter
}

For Auth, you just need to implement the SASL interface: http://godoc.org/github.com/mxk/go-imap/imap#SASL

kaihendry commented 10 years ago

Hmmm, getting:

missing ',' before newline in composite literal

On that code sample