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

Re: multi-hook send-hooks



On 2006-05-03, Eric Smith <es@xxxxxxxxxxxx> wrote:
> Is it possible to read all the email addresses I want to hook
> from a file or list rather than this awkard and difficult to
> maintain notation:
> 
> send-hook "~C (dsdf@xxxxxxxxxx\\|another@xxxxxxxxx\\|...) set whatever
> 
> ?

Sort of.  That is, the send-hook command doesn't support that 
capability, but you can replace the send-hook commands in your 
muttrc with a source command, like this:

    source "myhookgen|"

where myhookgen is a program (written in any language you like) that 
generates send-hook commands from a list of addresses.  For example:

    #!/usr/bin/sh
    while read address
    do
        echo 'send-hook "~C '$address'" set whatever'
    done <<EOF
    dsdf@xxxxxxxxxx
    another@xxxxxxxxx
    EOF

HTH,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA