The Mutt E-Mail Client : Advanced Usage : Using Hooks
Previous: Using Tags
Next: Message Matching in Hooks

## 4.4. Using Hooks

A hook is a concept borrowed from the EMACS editor which allows you to execute arbitrary commands before performing some operation. For example, you may wish to tailor your configuration based upon which mailbox you are reading, or to whom you are sending mail. In the Mutt world, a hook consists of a regular expression or pattern along with a configuration option/command. See

- folder-hook
- send-hook
- message-hook
- save-hook
- mbox-hook
- fcc-hook
- fcc-save-hook

for specific details on each type of hook available.

Note: if a hook changes configuration settings, these changes remain effective until the end of the current mutt session. As this is generally not desired, a default hook needs to be added before all other hooks to restore configuration defaults. Here is an example with send-hook and the my_hdr directive:

> `

>     send-hook . 'unmy_hdr From:'
>     send-hook ~Cb@b.b my_hdr from: c@c.c

> `

### 4.4.1. Message Matching in Hooks

The Mutt E-Mail Client : Advanced Usage : Using Hooks
Previous: Using Tags
Next: Message Matching in Hooks