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

Re: folder-hook commands



On 2009-05-05, Alex Huth wrote:
> Hello!
> 
> I have a problem using a command in folder-hooks. I wnat to read a
> config file using folder-hooks:
> 
> folder-hooks:
> folder-hook   . set sort = reverse-date-received
> folder-hook   = freebsd-current source ~/.mutt/defaults.maillist
> 
> defaults.maillist:
> set sort = threads
> set strict_threads = yes
> set collapse_unread = yes
> set uncollapse_jump = yes
> 
> Using this i get "unknown command" when i open the mailbox. Is it
> not possible to use "source" in folder-hooks? If not how can i
> configure it to get it working?

The folder-hook command is expecting to see the command as a single
argument.  Therefore, if the command includes any whitespace, the
command must be enclosed in quotes, or the whitespace otherwise
removed.  With that change, your hooks would become:

    folder-hook   . "set sort=reverse-date-received"
    folder-hook   =/freebsd-current "source ~/.mutt/defaults.maillist"

I removed the spaces surrounding the = in the set command because
the manual doesn't indicate that spaces are allowed there.  I also
added a / in the folder name of the second folder-hook, assuming
that one belongs there.

HTH,
Gary