* On 09 Nov 2012, Chris Green wrote: 
> 
> How can I switch the From address according to the hostname?  It won't

Solution 1.

# muttrc
source muttrc.`hostname`

# muttrc.zbmc.eu
my_hdr From: Chris Green <[email protected]>

# muttrc.cheddar.halon.org.uk
my_hdr From: Chris Green <[email protected]>


Solution 2.

source "mutt-localrc |"

#!/bin/sh
# mutt-localrc: provide dynamic local settings

host_zbmc_eu () {
        echo "my_hdr From: Chris Green <[email protected]>"
}

host_cheddar_halon_org_uk () {
        echo "my_hdr From: Chris Green <[email protected]>"
}

host_$(hostname | tr . _)

> *use* the host name in the From address, I just want to be able to
> detect the host name and set the From address accordingly.  I need a
> sort of send-hook with pattern matching on an external (host name)
> parameter. 
> 
> Specifically I want (using existing send-hook syntax):-
> 
>     On host zbmc.eu:- 'my_hdr From: Chris Green <[email protected]>'
> 
>     and on host cheddar.halon.org.uk:- 'my_hdr From: Chris Green 
> <[email protected]>'
> 
> 
> -- 
> Chris Green

-- 
David Champion • [email protected]

Reply via email to