Skip to content

fix(imap): skip a sender-less message when defaulting a draft's recipient - #1

Open
potiuk wants to merge 1 commit into
sharpca:fix/imap-truncated-thread-agreementfrom
potiuk:imap-1965-review-fixups
Open

potiuk wants to merge 1 commit into
sharpca:fix/imap-truncated-thread-agreementfrom
potiuk:imap-1965-review-fixups

Conversation

@potiuk

@potiuk potiuk commented Nov 2, 2026

Copy link
Copy Markdown

Summary

Fixups for the review on apache#1965 (apache#1965 (review)), as a PR to your branch since it doesn't allow maintainer edits. Merge it here and apache#1965 picks it up; or take the changes into your own commit if you prefer.

  • _first_foreign_sender (tools/mail-source/imap/src/imap_source/create_draft.py) skips a message with no parseable From. Before, a sender-less earliest message made create_draft exit with cannot address the draft: the thread has no parseable From even when the reporter replied later in the window. Regression test added.
  • The default-recipient sentence in tools/mail-source/contract.md is scoped to the root-missing case and to backends that default a recipient (maildir's create_draft always takes an explicit to).
  • The redundant root if … else conditional and the never-false addressee is not None guard in create_draft are dropped.

Test plan

  • pytest (43 passed), ruff check, ruff format --check, mypy in tools/mail-source/imap

Gen-AI disclosure: prepared with Claude Code (Opus 5.5) and reviewed by the maintainer before submission.

🤖 Generated with Claude Code

…ient

Review fixups for apache#1965.

- `_first_foreign_sender` no longer picks a message with no parseable
  `From`: such a message made `create_draft` refuse a thread whose
  reporter replied later in the window. Regression test added.
- The default-recipient sentence in `tools/mail-source/contract.md` is
  scoped to the root-missing case and to backends that default a
  recipient; maildir's `create_draft` always takes an explicit `to`.
- Drop the redundant `root if ... else` conditional and the never-false
  `addressee is not None` guard in `create_draft`.

Generated-by: Claude Opus 5
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.

1 participant