don't trim too much

* I hate IMAP.
This commit is contained in:
Alexander Weinhold 2017-09-21 17:21:22 +02:00
parent c64feb082d
commit e20e862889

View File

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