pentelic
pentelic-ai/penmail
DesignDesignEssay · 310 words

Why Penmail will reply from the right address

If you read mail for more than one address, every client eventually sends a reply from the wrong one. Here is how Penmail is being designed to decide which identity a reply belongs to.

Why Penmail will reply from the right address

Penmail exists because of one recurring mistake. A customer writes to support@, the message lands in a personal inbox through a forwarding rule, and the reply goes out from the personal address. The customer now has a private email they should not have, and the support thread is broken in two. Most mail clients pick the sending identity from the account the message sits in. That is the wrong question, and Penmail is being built to ask a better one.

01The headers already know

By the time a message reaches you, the servers on the way have usually written down where it was going. The To header is what the sender typed, which may be an alias or a list. Delivered-To and X-Original-To are what the receiving server actually matched. Envelope-To records the final mailbox after forwarding.

message headersEML
Delivered-To: [email protected]
X-Original-To: [email protected]
Envelope-To: [email protected]
To: "CaseWizard Help" <[email protected]>

02The order we plan to trust them in

The design walks those headers from the most specific to the least, and stops at the first address that matches an identity you can send from. In the example above, help@ is an alias of support@, so the reply should leave from [email protected] even though the message was read in a personal inbox. If nothing matches, Penmail falls back to the account and shows the choice in the composer instead of hiding it.

The From field in the composer will be locked to that resolved identity and marked with the account's colour, so you can see the decision before you send. Changing it should take one click. Getting it wrong silently is not something we want to offer, because the cost of a wrong reply lands on the person who receives it.

None of this has shipped. It is the rule the code is being written against, and the reason this essay exists is so you can tell us where it breaks before it does.

GitHub issues· pentelic-ai/penmail

Have a question or a counterpoint?

Have a header setup that would fool this design? Open an issue with it; it is exactly the case we want to plan for.

All 3 dispatchesAll 3