On Thu, Jan 20, 2022 at 12:26:40PM +0100, Jens John wrote: > On Thu, 20 Jan 2022, at 10:52, Chris Green wrote: > > The first one is easy (I think?!) but how can I do the second one > > where my_hdr bears no relation to the hostname? > > According to the mutt man page: > > > It is also possible to substitute the output of a Unix command in an > initialization file. This is accomplished by enclosing the command in > backticks > (`command`). > > In a very simple case, setting From: based on shell logic: > > my_hdr From: `case "$(hostname --fqdn)" in zbmc.eu) echo 'Chris Green > <ch...@isbd.co.uk>' > ;; *) echo 'Chris Green <ch...@halon.org.uk>' ;;` > > If you're always running from a shell that guarantees $HOSTNAME to be set, > you could remove the subshell $(). You can also freely adjust the shell > expression. > Ah, thank you, that's the sort of thing I needed. I was thinking I might need to use muttLisp but using backquotes for shell execution makes more sense for my particular case.
-- Chris Green