From e20e8628896a7dca21313b7b41cf171b31e4d088 Mon Sep 17 00:00:00 2001 From: Alexander Weinhold Date: Thu, 21 Sep 2017 17:21:22 +0200 Subject: [PATCH] don't trim too much * I hate IMAP. --- imap/imap.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)