procmail notes

14 Sep 2006

procmail notes

Good procmail sites

Procmail commands can consist of.

  • a statement
FOO=`formail ... | sed ...`
  • a recipe

A recipe consists of three parts.

  • a colon line
  • zero or more condition lines
  • an action section
:0
 email_folder/
:0
 * From: ...
 email_folder/

An action is one of.

  • a folder
email_folder
 email_folder/
  • a forward
!foo@bar
  • a pipe (with :0 fwh or :0 fwb colon flags)
| formail -I ...
  • a curly brace
{

Curly Braces

A curly brace starts a nesting block ie a recipe can be:

  • a colon line, zero or more conditions, and curly brackets
:0
 {
     ...
 }
:0
 * From: ...
 {
     ...
 }

Inside curly brackets there must be one or more recipes.

How to do if-else

Do if-else using the E colon line flag

:0
 {
     :0
     * ^From: ...
     # deliver to default destination (inbox)
     ${DEFAULT}
 }
 :0E
 {
     # else
     ...
 }
comments powered by Disqus

  « Previous: Next: »