[neomutt-users] [help request] How can I change my from address depending on the sender?

Reto reto at labrat.space
Sat Dec 18 12:26:04 CET 2021

On Sat, Dec 18, 2021 at 12:28:31AM +0100, laalsaas at systemli.org wrote:
> Does this mean that the from-variable gets set to it's default value
> after sending the mails? Because the way I understand it is that this
> sets the variable for the rest of the session, so when you afterwards
> send an email to some address you haven't defined a rule for you will
> send it form nmutt at jikken.de. Or do I miss something?

You generally need to double up hooks to reset them...
Make a less specific rule first, then override in subsequent other hooks

As an example:

reply-hook . 'unmy_hdr From:'
reply-hook '~h"Delivered-To: asdf at gmail\.com"' my_hdr from: asdf at gmail.com
reply-hook '~h"Delivered-To: reto at labrat\.space"' my_hdr from: reto at labrat.space

Is my version of a reply hook in case I've received stuff on a ML
address and wasn't a direct recipient.
That then uses the same address if you reply as it was received on.


More information about the neomutt-users mailing list