Various fixes for reply/reply-all logic#120
Conversation
klement
commented
Mar 9, 2026
- 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
left a comment
There was a problem hiding this comment.
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.
| 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]>
|
I’ve changed the logic to use |