bytbox / go-pop3

RFC1939 client implementation for go
MIT License
40 stars 21 forks source link

client.ListAll() problem #3

Open po1yb1ank opened 3 years ago

po1yb1ank commented 3 years ago

msgs, _, err := client.ListAll() tries to parse not only messages but also the server response strconv.Atoi: parsing "+OK": invalid syntax ListAll() needs to check for server response there

lines, err := c.ReadLines()
if err != nil {
    return
}
msgs = make([]int, len(lines), len(lines))
sizes = make([]int, len(lines), len(lines))
for i, l := range lines {
    var m, s int
    fs := strings.Fields(l)
    m, err = strconv.Atoi(fs[0])
    if err != nil {
        return
    }
bytbox commented 3 years ago

I'm really no longer maintaining this project. If you can submit a PR, I'll accept. Otherwise I suggest forking.