# NousResearch/hermes-agent · Inbound email: malformed/unknown encoding crash fixes

## Open now

- 0 issues, 2 PRs open on GitHub.
- PR #35910: fix(email): handle unknown-8bit charset from QQ Mail in IMAP fetch
- PR #55384: Tolerate an unknown email body charset in _extract_text_body

These issues and PRs address crashes during IMAP fetch caused by malformed RFC 2047 encoded headers and unknown or non-standard charsets (such as QQ Mail's 'unknown-8bit'), which abort message ingestion. The work focuses on making header decoding and body text extraction resilient to these bad inputs rather than raising unhandled errors.

## TL;DR

- 6 member(s): 0 open issue(s), 3 closed issue(s), 2 open PR(s), 0 merged PR(s), 1 PR(s) closed without merging.
- No fix has been merged to main; one or more PRs were attempted (see below).
- **Recommended:** review the prior/competing PR(s) below. A fix was attempted but not merged; your case may extend or revive that work.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `unresolved`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.25`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #35901: \[Email Gateway\] IMAP fetch error: unknown encoding: unknown-8bit with QQ Mail
- #55381: Inbound email: a malformed RFC 2047 header crashes _decode_header_value and aborts the IMAP fetch, dropping the message
- #55383: Inbound email: an unknown Content-Type charset crashes _extract_text_body (LookupError) and aborts the IMAP fetch

## Prior & competing PRs

- **#35910: fix(email): handle unknown-8bit charset from QQ Mail in IMAP fetch**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `5600105478ffde29d7566b45421b100eaa29c4ef`
  - files: `gateway/platforms/email.py`, `tests/gateway/test_email_encoding.py`
- **#55384: Tolerate an unknown email body charset in _extract_text_body**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#55382`, `#55383`
  - files: `tests/gateway/test_email.py`
- **#58070: fix(email): tolerate malformed encoded headers**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#55382`

## Fix status

- No merged fix on record.
- Subsystem: `gateway`
