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

Anton Rieger nmutt at jikken.de
Fri Dec 17 23:41:36 CET 2021


On Fri, Dec 17, 2021 at 09:24:06PM +0100, laalsaas+nmutt at systemli.org wrote:
>I'm trying to make neomutt automatically use a different From-address
>when I'm sending mails to a specific address. I tried just appending the
>following line to my neomuttrc:
>
>send-hook "~t ^~mil\/sxmo-devel at lists\.sr\.ht$" 'my_hdr "From: laalsaas+sxmo at systemli.org"'

send-hook is the right approach, I guess.
>
>This gives me an error when I start neomutt:
>
>Error in /home/philipp/.config/neomutt/neomuttrc, line 16: No Context
>source: errors in /home/philipp/.config/neomutt/neomuttrc

I never used ``my_hdr'' directive maybe someone who used it can help you here
>
>I have two questions:
>Is this even the right approach for reaching my goal?

Maybe, but I have a more straightforward way:
E.g. for this mailing list:

	send-hook neomutt-users at neomutt.org 'set from=nmutt at jikken.de'

This also worsk with "Username <account at domain.tld>", e.g.:
	send-hook wireguard at lists.zx2c4.com 'set from=inrin <inrin at jikken.de'

In my examples I did not use pattern directives, but I use them in save-hooks, so this
should work.


More information about the neomutt-users mailing list