The Mutt E-Mail Client : Advanced Usage : Compressed folders Support (OPTIONAL)
Previous: Start a WWW Browser on URLs (EXTERNAL)
Next: Open a compressed mailbox for reading

## 4.13. Compressed folders Support (OPTIONAL)

If Mutt was compiled with compressed folders support (by running the configure script with the --enable-compressed flag), Mutt can open folders stored in an arbitrary format, provided that the user has a script to convert from/to this format to one of the accepted.

The most common use is to open compressed archived folders e.g. with gzip.

In addition, the user can provide a script that gets a folder in an accepted format and appends its context to the folder in the user-defined format, which may be faster than converting the entire folder to the accepted format, appending to it and converting back to the user-defined format.

There are three hooks defined ( open-hook, close-hook and append-hook) which define commands to uncompress and compress a folder and to append messages to an existing compressed folder respectively.

For example:

> `

>     open-hook \\.gz$ "gzip -cd %f > %t"
>     close-hook \\.gz$ "gzip -c %t > %f"
>     append-hook \\.gz$ "gzip -c %t >> %f"

> `

You do not have to specify all of the commands. If you omit append-hook, the folder will be open and closed again each time you will add to it. If you omit close-hook (or give empty command) , the folder will be open in the mode. If you specify append-hook though you'll be able to append to the folder.

Note that Mutt will only try to use hooks if the file is not in one of the accepted formats. In particular, if the file is empty, mutt supposes it is not compressed. This is important because it allows the use of programs that do not have well defined extensions. Just use "." as a regexp. But this may be surprising if your compressing script produces empty files. In this situation, unset $save_empty, so that the compressed file will be removed if you delete all of the messages.

### 4.13.1. Open a compressed mailbox for reading

### 4.13.2. Write a compressed mailbox

### 4.13.3. Append a message to a compressed mailbox

### 4.13.4. Encrypted folders

The Mutt E-Mail Client : Advanced Usage : Compressed folders Support (OPTIONAL)
Previous: Start a WWW Browser on URLs (EXTERNAL)
Next: Open a compressed mailbox for reading