Skip to content

fix: default charset=None in search/uid_search#127

Open
mickey-mikey wants to merge 2 commits intoiroco-co:mainfrom
mickey-mikey:fix/uid-search-charset-default
Open

fix: default charset=None in search/uid_search#127
mickey-mikey wants to merge 2 commits intoiroco-co:mainfrom
mickey-mikey:fix/uid-search-charset-default

Conversation

@mickey-mikey
Copy link

@mickey-mikey mickey-mikey commented Feb 9, 2026

Summary

  • Changes default charset parameter from 'utf-8' to None in search(), uid_search(), and the protocol-level search() method
  • When charset=None, the CHARSET keyword is omitted from SEARCH commands, which is valid per RFC 3501 §6.4.4
  • Adds test test_search_default_charset_is_none verifying both default (None) and explicit charset behaviour for search() and uid_search()
  • Pins Poetry to 1.8.5 in CI workflow for Python 3.9 compatibility (Poetry 2.x dropped 3.9 support)

Problem

Yahoo's IMAP server does not support UTF-8 in SEARCH commands and rejects CHARSET utf-8 with BAD [CLIENTBUG]. Since search() and uid_search() default charset='utf-8', all search operations fail against Yahoo out of the box.

Fix

Default charset=None so SEARCH commands are sent without CHARSET by default. Callers with a specific need for charset encoding should pass it explicitly (e.g. charset='utf-8').

Breaking change

CHARSET is optional per RFC 3501 §6.4.4 — the correct default is None. Callers relying on the implicit CHARSET utf-8 being sent will need to pass charset='utf-8' explicitly.

Fixes #126

…jection

Yahoo's IMAP server does not advertise UTF8=ACCEPT or UTF8=ONLY in its
CAPABILITY response and rejects CHARSET utf-8 in SEARCH commands with
BAD [CLIENTBUG]. Per RFC 3501 §6.4.4, CHARSET is optional in SEARCH
commands, so defaulting to None (omitting it) is more correct and
compatible.

Fixes iroco-co#126

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mickey-mikey mickey-mikey force-pushed the fix/uid-search-charset-default branch from 87d7ad7 to c4a8ce1 Compare February 9, 2026 10:00
@mickey-mikey mickey-mikey marked this pull request as ready for review February 9, 2026 10:20
@mickey-mikey mickey-mikey marked this pull request as draft February 9, 2026 10:26
Poetry 2.x dropped Python 3.9 support, breaking CI for all PRs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mickey-mikey mickey-mikey marked this pull request as ready for review February 9, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uid_search fails on Yahoo IMAP: default charset='utf-8' sends unsupported CHARSET parameter

1 participant