#649·himalaya

Mail.ru IMAP: envelope list returns empty due to skipping invalid fetch

Author: pozysCreated Mar 15, 2026Updated Jul 25, 2026

Environment

  • himalaya: v1.2.0 (linux musl x86_64)
  • IMAP server: imap.mail.ru:993 TLS
  • Auth: password (app password)
  • Backend: backend.type = \"imap\"

What I'm trying to do

bash
himalaya envelope list --folder INBOX --page-size 1 --output json

Expected behavior Non-empty JSON array, since INBOX contains ~2000 messages.

Actual behavior Returns empty array [].

Trace shows successful auth and SELECT, but FETCH parsing fails:

* 1992 EXISTS
skipping invalid fetch ...
found 0 imap envelopes

Warnings during SELECT:

  • imap_codec::response: Rectified missing 'text' to \"...\"
  • missing required UNSEEN OK untagged response

Sample FETCH (redacted)

* 1992 FETCH (UID 153422 FLAGS (\\Seen) ENVELOPE (\"Wed, 11 Mar 2026 03:19:50 +0000\" \"=?utf-8?B?...?=\" ((\"AdminVPS\" NIL \"noreply\" \"my.adminvps.ru\")) NIL ((\"AdminVPS\" NIL \"noreply\" \"my.adminvps.ru\")) ((\"=?utf-8?B?0JrQvtC90YHRgtCw0L3RgtC40L0g0JrRg9C70YzRgtGP0L/QvtCy?=\" NIL \"pozys\" \"mail.ru\")) NIL NIL NIL \"<redacted>\") BODYSTRUCTURE (((\"text\" \"plain\" (\"charset\" \"utf-8\") NIL NIL \"8bit\" 1721 0 NIL NIL NIL NIL)(\"text\" \"html\" (\"charset\" \"utf-8\") NIL NIL \"8bit\" 31289 0 NIL NIL NIL NIL) \"alternative\" (\"boundary\" NIL))(\"application\" \"pdf\" (\"name\" \"=?UTF-8?Q?=D0=A1=D1=87=D0=B5=D1=82-999688.pdf?=\") NIL NIL \"base64\" 134262 NIL (\"attachment\" (\"filename\" \"=?UTF-8?Q?=D0=A1=D1=87=D0=B5=D1=82-999688.pdf?=\")) NIL NIL) \"mixed\" (\"boundary\" NIL)))

This happens for every message, not a single "bad email".

Question Is this a known issue with Mail.ru IMAP / BODYSTRUCTURE parsing? Any workaround or fix planned?