mail-mcp/crates
Kayos 6fb63b0ca0 audit-fix round 3: LOW-1 mime cleanup, INFO-2 drop empty snippet, INFO-3 unit tests + format_imap_since tightening
- LOW-1: mime_type construction simplified. Single `content_type().map()`
  with proper fallback instead of two unwrap_or chains where the second
  default could never fire.
- INFO-2: ListEntry.snippet field dropped. Was always an empty string
  because list mode doesn't fetch the body. Field stays out until /
  unless we add a partial-body fetch in Phase C.
- INFO-3: 18 unit tests for the pure validation helpers — validate_mailbox
  (accept + reject CR/LF/NUL/quote/backslash), has_imap_literal (with /
  without digits), format_imap_since (canonical + bad-shape rejection),
  strip_msgid_braces, clamp_limit, render_flag (every variant +
  Custom), strip_quotes (matched / unmatched / inner / empties),
  civil_from_unix (epoch / Y2K / 2026-05-21 / pre-epoch / leap day).
- Bonus catch from the test suite: format_imap_since accepted
  malformed shapes like "21-05-2026" (parsed as y=21 m=5 d=2026)
  and "2026-5-21" (no field-width check). Added 4-2-2 digit-width
  check + year range (1900..=9999) + day range (1..=31). Month range
  was already enforced.

All 18 tests pass.
2026-05-21 08:00:50 -07:00
..
mail-mcp audit-fix round 3: LOW-1 mime cleanup, INFO-2 drop empty snippet, INFO-3 unit tests + format_imap_since tightening 2026-05-21 08:00:50 -07:00