I use a different email address for each service I sign up for, for example jj+uber@example.com or netflix@jj.example.com (thanks to Fastmail's subdomain addressing). Mail to all these addresses arrives in the same inbox.

When replying, I would like Mutt to automatically set the From: header to the address the original email was sent to. I have tried setting reverse_name = yes according to the documentation but this requires me to specify all the possible From: addresses in advance as "alternates":

If this variable is set, the default From: line of the reply messages is built using the address where you received the messages you are replying to if that address matches your “alternates”.

Currently, I press Esc F to edit the from address manually for every email I reply to. How can I set the From: address of my replies automatically?


The following configuration achieves this:

set reverse_name = yes
alternates = @example.com @jj.example.com

This works because the alternates are interpreted as regular expressions. The first expression matches jj+ANYTHING@example.com and the second one matches ANYTHING@jj.example.com.

Using this configuration, when you reply to any email, the From: address will be automatically set to the To: address of the original email.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.