| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can use elmo-split to split message in folder specified by
the variable elmo-split-folder a la procmail according
to some specified rules. To use this feature, set as follows in your
`~/.emacs' at first.
(autoload 'elmo-split "elmo-split" "Split messages on the folder." t) |
Set source folder like following.
(setq elmo-split-folder "%inbox") |
And specify the rule in the variable elmo-split-rule (its format
will be is described below).
Then you can invoke M-x elmo-split to split messages according to
elmo-split-rule. On the other hand, invoke C-u M-x elmo-split
to do a rehearsal and show result (do not split actually).
We will describe how to specify the rule. First of all, see following example, please.
(setq elmo-split-rule
;; Store messages from spammers into `+junk'
'(((or (address-equal from "i.am@spammer")
(address-equal from "dull-work@dull-boy")
(address-equal from "death-march@software")
(address-equal from "ares@aon.at")
(address-equal from "get-money@richman"))
"+junk")
;; Store messages from mule mailing list into `%mule'
((equal x-ml-name "mule") "%mule")
;; Store messages from wanderlust mailing list into `%wanderlust'
;; and continue evaluating following rules
((equal x-ml-name "wanderlust") "%wanderlust" continue)
;; Store messages from Yahoo user into `+yahoo-{username}'
((match from "\\(.*\\)@yahoo\\.com")
"+yahoo-\\1")
;; Store unmatched mails into `+inbox'
(t "+inbox")))
|
The basic unit of the rule is a combination like
(`CONDITION' `ACTION' [ |
If `CONDITION' is true, `ACTION' is performed.
The 1st element `CONDITION' is a condition represented by a
balanced expression (sexp). Its grammar will be explained below.
The 2nd element `ACTION' is the name of the folder to split
messages into, or a symbol. When the 3rd element continue is
specified as symbol, evaluating rules is not stopped even when the
condition is satisfied.
The grammar for `CONDITION' is as follows. See example above to learn how to write the condition practically.
equal
match
\& and \N which will substitute
from matching \(\) patterns in the previous `VALUE'.
address-equal
address-match
\& and \N which will substitute
from matching \(\) patterns in the previous `VALUE'.
<
>
or
and
When a symbol is specified, it is evaluated.
You can specify followings as 2nd `ACTION'.
If some string is specified, it will be regarded as the destination folder, and the message will be appended to it.
If the symbol `delete' is specified, delete the substance of the
message in elmo-split-folder
If the symbol `noop' is specified, do nothing on the message and keep it as it is.
If some function is specified, execute it.
If the message passes all rules, it will be dealed along `ACTION'
specified by elmo-split-default-action.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |