Skip to content

Various fixes for reply/reply-all logic#120

Open
klement wants to merge 2 commits into
akissinger:masterfrom
klement:master
Open

Various fixes for reply/reply-all logic#120
klement wants to merge 2 commits into
akissinger:masterfrom
klement:master

Conversation

@klement

@klement klement commented Mar 9, 2026

Copy link
Copy Markdown
Contributor
  • Fix case-sensitive email address comparison in email_is_me and email_smtp_account_index
  • Fix empty To: field when replying from a self-authored message
  • Fix empty To: field when replying in threads between own accounts

…smtp_account_index

Email address comparison was case-sensitive, causing the user's own
addresses to not be recognized when the case in message headers
differed from the configured address (e.g. "[email protected]"
vs "[email protected]"). This resulted in the user's other
account leaking into the Cc: field on reply-all.

Per RFC 5321 Section 2.4, the domain part of an email address is
case-insensitive. While the local part is technically case-sensitive,
in practice virtually all mail systems treat it as case-insensitive.
Normalize both sides to lowercase before comparison.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

@The-Compiler The-Compiler left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the "you can't reply to yourself" behavior is a good idea to be honest. The other fixes seem fine in principle, but as mentioned in #90 (comment) personally I'd rather just have notmuch do the heavy lifting here, instead of Dodo reinventing the wheel.

Comment thread dodo/thread.py Outdated
msg = self.current_message

# If the current message is from the user, find the last message in the
# thread that isn't from the user to reply to instead.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite this being what the comment above hinted at, I find this really weird behavior.

Sometimes I reply to my own message to follow up with some additional information/context, and I want to quote myself. I don't think any other mail client shows this behavior, and the previous behavior was perfectly fine there.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also a NACK on this specific change. Not only would it break quoting, it would also drop all recipients that were only added in that last email, which seems counter-intuitive to me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree and thanks for spotting me, I guess I got confused when testing by sending emails between two of my accounts.

Replace manual reply header construction with notmuch reply --format=json,
which properly handles To/Cc/From/Subject/In-Reply-To/References headers
including Reply-To priority, address filtering, and UTF-8 encoding.

This also fixes the encoded address display issue (akissinger#90) since notmuch
returns properly formatted addresses without re-encoding them.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@klement

klement commented Mar 13, 2026

Copy link
Copy Markdown
Contributor Author

I’ve changed the logic to use notmuch reply. Can you take a look?
Feel free to update the PR title.

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.

3 participants