Variable: rmail-automatic-folder-directives
rmail-automatic-folder-directives is a customizable variable defined
in rmail.el.gz.
Value
nil
Documentation
List of directives specifying how to automatically file messages.
Whenever Rmail shows a message in the folder that rmail-file-name
specifies, it calls rmail-auto-file to maybe file the message in
another folder according to this list. Messages that are already
marked as filed, or are in different folders, are left alone.
Each element of the list is of the form:
(FOLDERNAME FIELD REGEXP [ FIELD REGEXP ] ... )
FOLDERNAME is the name of a folder in which to put the message. If FOLDERNAME is nil then Rmail deletes the message, and moves on to the next. If FOLDERNAME is "/dev/null", Rmail deletes the message, but does not move to the next.
FIELD is the name of a header field in the message, such as
"subject" or "from". A FIELD of "to" includes all text
from both the "to" and "cc" headers.
REGEXP is a regular expression to match (case-sensitively) against the preceding specified FIELD.
There may be any number of FIELD/REGEXP pairs. All pairs must match for a directive to apply to a message. For a given message, Rmail applies only the first matching directive.
Examples:
("/dev/null" "from" "@spam.com") ; delete all mail from spam.com
("RMS" "from" "rms@") ; save all mail from RMS.
This variable was added, or its default value changed, in Emacs 21.1.
Probably introduced at or before Emacs version 21.1.
Source Code
;; Defined in /usr/src/emacs/lisp/mail/rmail.el.gz
(defcustom rmail-automatic-folder-directives nil
"List of directives specifying how to automatically file messages.
Whenever Rmail shows a message in the folder that `rmail-file-name'
specifies, it calls `rmail-auto-file' to maybe file the message in
another folder according to this list. Messages that are already
marked as `filed', or are in different folders, are left alone.
Each element of the list is of the form:
(FOLDERNAME FIELD REGEXP [ FIELD REGEXP ] ... )
FOLDERNAME is the name of a folder in which to put the message.
If FOLDERNAME is nil then Rmail deletes the message, and moves on to
the next. If FOLDERNAME is \"/dev/null\", Rmail deletes the message,
but does not move to the next.
FIELD is the name of a header field in the message, such as
\"subject\" or \"from\". A FIELD of \"to\" includes all text
from both the \"to\" and \"cc\" headers.
REGEXP is a regular expression to match (case-sensitively) against
the preceding specified FIELD.
There may be any number of FIELD/REGEXP pairs.
All pairs must match for a directive to apply to a message.
For a given message, Rmail applies only the first matching directive.
Examples:
(\"/dev/null\" \"from\" \"@spam.com\") ; delete all mail from spam.com
(\"RMS\" \"from\" \"rms@\") ; save all mail from RMS."
:group 'rmail
:version "21.1"
:type '(repeat (sexp :tag "Directive")))