<<< Date Index >>>     <<< Thread Index >>>

Re: Automatically setting the from: header based on to:



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday, May  9 at 04:21 PM, quoth Plead Insanity:
>Hi, I have many different email aliases all going into one account.  I
>have been trying to figure out a way to get mutt to recognize the To:
>header and compose massages with the person the email address was sent
>*to* as the *from* header.

You want to re-read the $reverse_name documentation.

>I tried out the set reverse_name, and set envelope_from options, but
>they seemed to have no effect.

Here's the critical part of the $reverse_name documentation that you 
missed:

     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.

Translation: you need to *also* set up your alternates. If you think 
about it, it makes sense: mutt needs to know which addresses are 
*you*, and which ones are not (you don't want it to do something like 
*always* use the To header as the From header---mailing lists, CC's, 
forwards, all sorts of things would break).

To set up alternates, you would add something like this to your muttrc 
(don't use this just yet - I'll explain in a moment):

     set reverse_name
     alternates jay-mutt@xxxxxxxxxxxx alias1@xxxxxxxxxx
     alternates alias2@xxxxxxxxxx

Now, keep in mind, the "alternates" command takes *patterns*, and you 
generally want to be strict with those. So, to start with, that should 
be:

     set reverse_name
     alternates '^jay-mutt@xxxxxxxxxxxx$' '^alias1@xxxxxxxxxx$'
     alternates '^alias2@xxxxxxxxxx$'

To save typing, I use something like this:

     alternates '^kyle-[a-z0-9-]*@memoryhole.net$'

~Kyle
- -- 
America will never be destroyed from the outside. If we falter and 
lose our freedoms, it will be because we destroyed ourselves.
                                                     -- Abraham Lincoln
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iEYEARECAAYFAkgkxpQACgkQBkIOoMqOI17O/QCfepBB6JRLanwMpvi6s7DvGfXu
mu8AnAon4dOR9o1KmXoNtBXbNeWET93V
=bBU6
-----END PGP SIGNATURE-----