Yample(1) Yet Another Mail Processing Language.

FILES


~/.yample/rules

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.

Yample::Rules
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.
dup()
Detects duplicates.
rcpt()
The rcpt rule matches against the To- and Cc-headers.
sender()
The sender rule matches against the From-header.
subject()
Matches on the subject of the message.
list()
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)

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

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

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

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

resend()
Parameters: Where the message is to be forwarded.
reject()
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()
Ignore the message silently.

Parameters: none

reply()
Reply to the message.

Parameters: The body of the reply.

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

~/.yample/dupdb

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

~/.yample/log

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

~/.forward

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