diff --git a/imap/imap.go b/imap/imap.go index 164a3cf..a28d8ee 100644 --- a/imap/imap.go +++ b/imap/imap.go @@ -120,8 +120,8 @@ func fetch(c *connection, ids []int) stateFunc { c.write(cmd(fmt.Sprintf("uid fetch %d body[]", id))) if len(c.err) == nErrs { s := c.read("uid fetch of " + strconv.Itoa(id)) - s = strings.TrimRight(s, ")\r\n") if len(c.err) == nErrs { + s = strings.TrimSuffix(strings.TrimSpace(s), ")") mail, err := parseMail(s) if err == nil { c.unreadMails = append(c.unreadMails, mail)