mutt config: reply with address that mail was sent to [closed]
Asked Answered
S

2

10

Okay so here's the deal. I've got a school email adress (say [email protected]) that is held on an outlook server. Because I really dislike outlook, I have this mail forwarded to a gmail address (say [email protected]).

I've managed to set up mutt and gmail so that when I send a mail from the gmail account, it seems as if it is sent from the school account (the "from" and "reply-to" fields show [email protected] instead of [email protected]).

Now, I've started using the gmail account as a normal email address too (putting that in contact info) so poeple start mailing me at [email protected], yet some poeple still email me at [email protected].

Is there a way to set up mutt and gmail so that it automagically replies using the correct email address (eg the one the mail was sent too in the first place)?

Sophy answered 6/8, 2012 at 15:16 Comment(0)
M
14

First, you have to also set up your gmail, so it sends e-mail from both addresses.

Then you can add to lines in .muttrc:

alternates "[email protected]|[email protected]"
set reverse_name
Magnetron answered 6/3, 2013 at 16:11 Comment(1)
FYI, I was using regexp like alternates alternates ^[email protected]$ ^[email protected]$ which didn't work, whereas this solution works.Distasteful
E
2

You can use the folder-hook directive if you store your mails in folder.

folder-hook .      "set [email protected]"
folder-hook school "set [email protected]" 

Otherwise you can use send-hook

send-hook '~t ^romeo@school\.com$' 'my_hdr From: [email protected]'

Look at the this page for hooks.

Exertion answered 23/10, 2012 at 14:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.