Yample(1) Yet Another Mail Processing Language.



This file contains the rules which Yample uses to sort mail. Yample reads the mail from STDIN and then processes the rules, one by one.

The rules consists of two parts; condition(s) and target. There is an implicit if .. then .. else between every rule. Please see the examples futher down.

In the conditions which take a regular expression as a parameter you can use grouping to extract parts of the text and utilize this in the sorting. Like this: ``subject((.*)) and rcpt([email protected]): reject(Your message with subject $1 was rejected)''. Cool, eh?

NOTE: We replace ``/'' and ``.'' with ``_'' in grouped strings to make sure there won't be any funny business.

This package contains subroutines which handle the individual rules. The rules are transformed into perl code which will call these methods to decide what to do with the message.
Detects duplicates.
The rcpt rule matches against the To- and Cc-headers.
The sender rule matches against the From-header.
Matches on the subject of the message.
If Yample can load Mail::Listdetect then list() can be used to match against the name of the mailing list (unless the mailing list server is completely lame).

You can use this rule like this:

list((.*)): maildir(.lists.$1)

Match against a arbitrary header. Note the caret (^)

head(^X-Spam-Flag: YES): maildir(.junk.spam) head(^X-Infected:): maildir(.junk.virii)

If Yample loads Spamassassin (and runs the message through it) you can use spam() to determine the status of the message.
Run arbitrary perl code. Unless you are some sort of pervert you would not use this for anything but testing and debugging Yample.
Action dispatcher class. All the targets are defined here.
Stores the message in a UW-style maildir more or less as defined per RFCXXXX.
Delivers mail to a standard Unix mailbox.

Parameters: The mailbox where the message is to be delivered.

Parameters: Where the message is to be forwarded.
Reject the message. This normally forces your mail server to create a bounce and mail this to the original sender.

Parameters: Error message. This message will probably be included in the bounce generated.

Ignore the message silently.

Parameters: none

Reply to the message.

Parameters: The body of the reply.

Parameters: The command which is message is to be piped into. Executed through ``/bin/sh -c''.


Yamples database of message IDs. Yample uses this to supress dupicate messages (see dup() rules).


Your own personal logfile. You might want to use logrotate or similar programs to make sure it does not grow to big.


Usually, your mail server looks for a file in your home directory called ``.forward''. This file contains information how your mail server should deliver your mail. If you want Yample as your MDA your .forward should look like this: |/full/path/to/yample