VM User's Manual. Node: Spool Files

PREV Starting Up UP Starting Up NEXT Getting New Mail

1.1: Spool Files

A spool file is a file where the mail transport system delivers messages intended for you. Typically a program called `/bin/mail' or `/bin/mail.local' does this delivery, although agents such as `procmail', `filter' and `slocal' can be invoked from a user's `~/.forward' or `~/.qmail' files. No matter what the delivery agent, what all spool files have in common is that mail is delivered into them by one or more entities apart from VM and that all access to spool files must therefore be accompanied by the use of some file locking protocol.

VM leaves the task of accessing spool files to `movemail', a program distributed with Emacs that is written for this purpose. The variable vm-movemail-program specifies the name of the movemail program and defaults to `"movemail"'.

Every folder, including the primary inbox, can have one or more spool files associated with it. You make these associations known to VM by setting the variable vm-spool-files.

If you only want to associate spool files with your primary inbox, you can set vm-spool-files to a list of strings. By default, the location of your system mailbox (the spool file that is associated with your primary inbox) is determined heuristically based on what type of system you're using. VM can be told explicitly where the system mailbox is by setting vm-spool-files like this:

(setq vm-spool-files '("/var/spool/mail/kyle" "~/Mailbox"))

With this setting, VM will retrieve mail for the primary inbox from first `/var/spool/mail/kyle' and then `~/Mailbox'.

If the value of vm-spool-files is nil, a default value for vm-spool-files will be inherited from the shell environmental variables MAILPATH or MAIL if either of these variables are defined. This inheritance happens before your init file is loaded, so setting vm-spool-files in your init file will override any environmental variables.

If you want to associate spool files with folders other than or in addition to the primary inbox, the value of vm-spool-files must be a list of lists. Each sublist specifies three entities, a folder, a spool file and a crash box. When retrieving mail for a particular folder, VM will scan vm-spool-files for folder names that match the current folder's name. The spool file and crash box found in any matching entries will be used for gather mail for that folder.

For example, you can set vm-spool-files like this

(setq vm-spool-files
        ("~/INBOX"      "/var/spool/mail/kyle"      "~/INBOX.CRASH")
        ("~/INBOX"      "~/Mailbox"                 "~/INBOX.CRASH")
        ("~/Mail/bugs"  "/var/spool/mail/answerman" "~/Mail/bugs.crash")

The folder `~/INBOX' has two spool files associated with it in this example, `/var/spool/mail/kyle' and `~/Mailbox'. Another folder, `"~/Mail/bugs"' has one folder `/var/spool/mail/answerman' associated with it. Note that both of the `~/INBOX' entries used the same crash box. The crash box can be the same if the folder name is the same. Different folders should use different crashboxes.

An alternate way of specifying folder/spool file associations is to use the variables vm-spool-file-suffixes and vm-crash-box-suffix.

The value of vm-spool-file-suffixes should be a list of string suffixes to be used to create possible spool file names for folders. Example:

(setq vm-spool-file-suffixes '(".spool" "-"))

With vm-spool-file-suffixes set this way, if you visit a folder `~/mail/beekeeping', when VM attempts to retrieve new mail for that folder it will look for mail in `~/mail/beekeeping.spool' and `~/mail/beekeeping-' in addition to scanning vm-spool-files for matches. The value of vm-spool-files-suffixes will not be used unless vm-crash-box-suffix is also defined, since a crash box is required for all mail retrieval from spool files.

The value of vm-crash-box-suffix should be a string suffix used to create possible crash box file names for folders. When VM uses vm-spool-file-suffixes to create a spool file name, it will append the value of vm-crash-box-suffix to the folder's file name to create a crash box name. If the value of vm-spool-files-suffixes is nil, then the value of vm-crash-box-suffix is not used by VM.

The idea behind vm-spool-file-suffixes and vm-crash-box-suffix is to give you a way to have many folders with individual spool files associate with them, without having to list them all in vm-spool-files. If you need even more control of spool file and crash box names, use vm-make-spool-file-name and vm-make-crash-box-name. The value of both of these should be a function or the name of a function. When VM visits a folder, it will call the function with the name of the folder as an argument, and the function should return the spool file name or crash box name to be used for that folder.

If your spool file is on another host, VM supports accessing spool files on remote hosts using the POP and IMAP protocols.

  • POP Spool Files How to use a POP maildrop as a spool file
  • IMAP Spool Files How to use an IMAP maildrop as a spool file
  • PREV Starting Up UP Starting Up NEXT Getting New Mail