Re: Setting From: address for lists dependent on receiver address
Not much response to my question there. I got an idea:
In addition to the normal headers that mutt looks for to set the
$reverse-name variable, one user defined set of headers could be
investigated. Like:
set user-reverse-name-hdr="X-Original-To:"
The address from the first field would then also be matched against the
$alternates variable, just like To: and Cc: .
Is this a good idea?
Best regards
keld
On Sat, Dec 02, 2006 at 06:31:24PM +0100, Keld Jørn Simonsen wrote:
> I have a problem that for instance on this mutt list, I normally don't
> get an indication of how I received this mail in standard mail headers.
> And my address for this email list is different from my normal address.
> However this address is recorded on my system in a header X-Original-To:
> and such a header can be made available on other systems too.
>
> I am then wondering how to get this info into my From: header.
> I don't see ways to get it there via some hook command.
> I only see that I could do it via some external program executed in some
> backpling shell program. Like in .muttrc:
>
> set from=`get-original-to $this-mail default@xxxxxxxxxx`
>
> and then get-original-to :
>
> #!/bin/sh
> orig=`grep X-Original-To: $1 | head -n 1 | cut -d ' ' -f 2`
> # also take care of localhost address without "." :
> localaddress=`echo $orig | grep '\\.'`
> if [ "$orig" = "" -o "$localaddress" = "" ] ; then
> orig=$2;
> fi
> echo $orig
>
>
> ... But I dont see how I can get the current email passed to the shell
> in the backpling string. How can that be done?
>
> or is there a better way?
>
> Best regards
> keld