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

Re: setting sender address dependent on received address



On Thu, Nov 16, 2006 at 01:16:05PM -0500, Kyle Wheeler wrote:
> On Thursday, November 16 at 05:23 PM, quoth Keld Jørn Simonsen:
> > Hmmm, did so, to no avail. I had a line in ~/.muttrc :
> >
> > set reverse_name=yes
> >
> > and then mailed a message to myself at another machine. Replying to 
> > that mail did not give me the sender address of the adressee of the 
> > first mail.
> 
> You need to add all the possible reverse_name's to your list of 
> alternates first. For example, if you send mail from me@xxxxxxxx and 
> me2@xxxxxxxxx, you'd do this:
> 
>     set reverse_name=yes
>     alternates me@xxxxxxxx me2@xxxxxxxxx

Yes, it kind of worked now, I had also to remove my myhdr From: 
spec, which overrides the alternates spec, as also explained in the FAQ.

What I want is a default From: address, and then overridden if I am
replying to an email sent to one of my aliases. 

I tried:

set reverse_name=yes
alternates "alt1@xxxxxxxxxxx|alt2@xxxxxxxxxxx"
myhdr From: default@xxxxxxxxxxx
myhdr "From: $alternates"           
# assuming that if alternates is matched it is 
# put in the variable $alternates, and this can be used in a string

But it did not work. The ref manual only said that I could reference
environment variables in strings, and did not mention mutt variables.
And I did not see a kind of "if" statement to say something like:

if ($alternates == "") myhdr From: default@xxxxxxxxxxx

Hmm, maybe if the myhdr From: did not override the alternates, it would
work?

best regards
keld