wiki:MuttGuide/Hooks

Hooks are a feature of mutt that allows for certain dynamic / automatic behaviour. <br> NOTE: commands / settings are NOT restored after execution / processing of a hook. You have to provide a "default" match, that will catch everything that doesn't match your specific cases. However, do not provide a resetting "default" match for hooks which do not run a command (and change a setting).


mbox-hook foldername-regexp foldername

You can specify more than 1 "move-target" for read msgs when you have more than 1 different "inbox" folders defined by <tt>mailbox</tt>-cmd. This is useful when you use "procmail" to sort incoming email automatically into separate folders and need for each their own "read" folder.

send-hook mutt-pattern command

save-hook mutt-pattern filename

fcc-hook mutt-pattern filename

fcc-save-hook mutt-pattern filename

crypt-hook regexp key-id

message-hook mutt-pattern command

iconv-hook charset local-charset

charset-hook alias charset

folder-hook foldername-regexp command

  • every folder-hook that matches is executed.
  • the order matters: the latter overwrites the former.
  • you need "." as the default to initialize for all cases that are not explicitly set in the following hooks.
  • applies only when you actually open the folder, just accessing/ listing it in the folder-browser is not enough.

account-hook path-regexp command