procmail
[Top] [All Lists]

Re: procmail codes

1996-04-27 22:35:05
Patricia Buchanan <pblgroup(_at_)ix(_dot_)netcom(_dot_)com> writes:
To all:
 Where is there a list of all the procmail commands?  A few of them are 
in the man page procmail(1).  My server may not have everything.  It 
would be nice to understand the secret code.  

Try running "procmail -v"  at some point Stephen made it explain all
the command line flags and recipe flags.


What does E mean?  example :0 E

The 'E' is a recipe flag which makes thie recipe execute only if the
previous recipe didn't.  If a string of recipes all have the 'E' flag,
then at most one of them (or the recipe preceeding them all) will be
executed.  Just think of it changing the recipe from an 'if' into an
'else if'.


What does "X-Loop:   do ?
  example | formail -rA "X-Loop: Processed_Mail"

Why is the A in the above example?

The 'X-Loop:' is a message header that is used to prevent mail loops.
The idea is that if you're automatically sending out mail, then you
should only do so if the incoming mail that triggered it did *not*
have the same X-Loop: header as the message you're about to send.
This keeps a mailloop from accidentally (or maliciously) forming).

The formail command you show takes a message header and 'reverses' it,
(roughly) changing the 'From:' into the 'To:' (actually, it has an
algorithim for deciding which of the umpteen headers to use as the
new outgoing address). The -A flag (combined with the '-r' flag in
your example) adds a header, in this case, "X-Loop: Processes_Mail".


What does cat do?  Is it a series of commands or a command word?

cat is a command that simply concatenates the files given as arguments,
in the order given (con*cat*enate, get it?).  The 'magic' argument
consisting of just a minus sign ('-') is interpreted by cat to mean its
standard input, being the output from the previous command in the
pipeline.

I would suggest finding a local UNIX guru, and asking them to explain
UNIX's 'stdin' and 'stdout' (pronounced "standard in" and "standard
out") system of I/O, filtering principles, the methodology of the UNIX
'toolbox', and the key position of the shell in this.  I'm just not up
to doing (any of) the above at 12:30am, lieing on the floor pounding on
a MacSE.  If you asked for a book to read, I'd suggest
_Programming_in_the_UNIX_Environment_, by Kernighan [sic] and Pike.
Yes, it's really (>12 years I think) old.  But the principles it
teaches are critical.  And despite it's title, Brian and Rob spend most
of their time showing how you *don't* need to write a program in C or
anything like that, but rather just string together stuff that's
already been done.  At least 4 stars for this one, folks, and if you
were to ask me during the day, I'd probably give it another, but I
can't count that high right now...

Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>
  • procmail codes, Patricia Buchanan
    • Re: procmail codes, Philip Guenther <=