YAMPLE(1) | User Contributed Perl Documentation | YAMPLE(1) |
Yample - Yet Another Mail Processing Language.
Yample is an MDA - a mail delivery agent. It accepts a message via standard input and stores this message in a maildir or in a mbox.
Yample tries to incorporate the power of Perl and Mail::Internet, Mail::Spamassassin and the other Mail modules whilst maintaining an friendly syntax. Yample was written due to a personal conflict with Procmails syntax.
Look at the following lines, taken from "man procmailex";
:0 c * ^From.*peter * ^Subject:.*compilers ! william@somewhere.edu
:0 A petcompil
This can be implemented like this in Yample;
sender(peter) and subject(compilers) unseen resend(william@somewhere.edu) sender(peter) and subject(compilers) mbox(petcompil)
~/.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(user@foo.org): 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.
You can use this rule like this:
list((.*)): maildir(.lists.$1)
head(^X-Spam-Flag: YES): maildir(.junk.spam) head(^X-Infected:): maildir(.junk.virii)
Parameters: The mailbox where the message is to be delivered.
Parameters: Error message. This message will probably be included in the bounce generated.
Parameters: none
Parameters: The body of the reply.
~/.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
# throw away virii head(^X-Infected:): ignore()
# throw away spam with a score higher than 8 head(^X-Spam-Score: \d+\.\d+ \(\+{8,}\)
# The rest of the spam, tagged by spamassassin head(^X-Spam-Flag: YES): maildir(.junk.spam)
dup(): maildir(.junk.duplicates)
# auto-sort lists - requires Mail::Listdetect list((.*)): maildir(.lists.$1)
sender(@fjase.net) and subject(Backup report): maildir(.backup_reports)
# catch-all
perl(1): maildir()
Yample 0.30
Per Andreas Buer <perbu (at) linpro.no>
Yamples needs the following perl modules. Please download from CPAN, Yamples home page or other sources.
Mail::Internet Mail::Send Text::Balanced
Yample also uses these modules - but they are in the Perl distribution so they should always be there.
Pod::Usage POSIX Sys::Hostname IO::File IPC::Open2
Yample with Spamassassin, Mail::ListDetector and the other bells and whistles is quite heavy.
Please report bugs and functionality requests to the author.
Yample lacks (as of now) LMTP and IMAP support. Both should be fairly easy to implement.
Copyright (C) 2003 Per Andreas Buer
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Mail::Internet (3), Mail::SpamAssassin (3), Mail::ListDetector (3).
2004-01-13 | perl v5.8.2 |