=head1 NAME proctut0 - Procmail Basics =head1 SYNOPSIS This tutorial will discuss what procmail is and why it might be useful to you in controlling what comes into your mailbox. =head1 DESCRIPTION Procmail, at its heart, is a mail processor; it PROCesses MAIL. Part of its process is to scan the mail and look for anything you've told it to look for, and then to deliver the mail where you tell it to be delivered. Simple. Now the trick is to figure out how to tell it what to look for and what to do with it once it's found what it's looking for. A little terminology is appropriate here. =head2 Introduction to recipes Procmail uses B to determine what to look for and what to do once it's found what it's looking for. A simple procmail recipe might look like this: :0: * ^From:.*joe@schmoe\.org joe This recipe looks for email messages from 'joe@schmoe.org' and delivers them to a file called F. Once an email is delivered (i.e., written to a file), procmail stops processingL<[1]|proctut0.pod/Note_1> immediatelyL<[2]|proctut0.pod/Note_2> and all subsequent recipes are ignored. If an email message does not match a recipe (e.g., in this case, if the message were not from 'joe@schmoe.org'), the email moves on to the next recipe until a matching recipe is found. If no matching recipes are found, the next recipe file is examined. =head2 Where are the recipes? Procmail looks for recipes in the following locationsL<[3]|proctut0.pod/Note_3> (and in this order): /usr/local/etc/procmailrc (or /etc/procmailrc) $HOME/.procmailrc Once procmail finds one of the above files, it reads it for recipes. If the file does not exist, or none of the recipes match the email, procmail will read the next file until a matching recipe is found. If no matching recipes are found, the mail message is said to "drop off the end" and is delivered to the default mailbox for the recipient (e.g., F). =head1 SUMMARY Procmail is a powerful tool for scanning and redirecting incoming mail. Procmail uses recipes to determine what to look for and what to do with mail. Recipes are found in the F and F<$HOME/.procmailrc> filesL<[3]|proctut0.pod/Note_3>; procmail searches each of these files in turn until a matching recipe is found. Once a matching recipe is found, procmail delivers the mail and processing immediately ceasesL<[2]|proctut0.pod/Note_2> and subsequent recipes are skippedL<[1]|proctut0.pod/Note_1>. =head1 NOTES =over 4 =item Note 1 Unless you've made a I of your email with the 'c' flag. Discussed in subsequent articles. =item Note 2 We do not discuss I recipes here. We'll talk about those in later articles. =item Note 3 There is another location that is searched after the global F and before the user's F<$HOME/.procmailrc> file. This location is a directory and is located at F. Discussed in subsequent articles and in procmail(1). =back =head1 PREVIOUS This is the first procmail tutorial in a series. =head1 NEXT L =head1 SEE ALSO procmail(1), procmailrc(5), procmailex(5) =head1 AUTHOR Scott Wiersdorf =head1 COPYRIGHT Copyright (c) 2003 Scott Wiersdorf. All rights reserved. =head1 REVISION $Id: proctut0.pod,v 1.7 2003/09/17 13:16:07 deep Exp $