procmail
[Top] [All Lists]

Re: Language used in procmail recipes

1998-08-16 02:20:15
On Sat, 15 Aug 1998 10:12:10 -0700 (PDT), "Colin J. Raven"
<cjraven(_at_)quik(_dot_)com> wrote:
reading over (many) previous posts to this list, some recipes get really
complex. I wondered if anyone could actually state what language is used
to write a procmail recipe. Is it Perl? C? awk? sed?

Huh? Procmail recipes are written in something I think is variously
referred to as "procmailrc syntax", "Procmail's syntax", "the syntax
understood by Procmail", or "complete gobbledygook". If you mean, do
people use other languages as preprocessors to produce recipes in this
syntax, I would say that it's perfectly doable but relatively unusual.
(I.e. you would have a sed script which reads a file of domain names
and produces a .procmailrc with a separate recipe for each of those
domain names.)

As a complete newcomer I have to wonder what perticular language I
should spend *the* most time on, in order to master procmail's
recipes and to better understand the intricacies of the program.

Shell programming, definitely (but this is of course just IMHO).

Besides the fact that this is the language you use for "|" actions
(which in turn of course gives you the opportunity to invoke Perl,
awk, sed, or your own compiled C programs), a lot of Procmail's
general functionality starts making sense when you see how similar it
is to how the shell works. (Make sure you learn Bourne shell, not csh
or tcsh. The FAQs for the newsgroup comp.unix.shell would be a good
place to start; I have some links at <http://www.iki.fi/~era/unix/>
which should take you to some good starting points on the web,
including links to those FAQs.)

A related but complementary topic to concentrate on is regular
expressions. Any good shell programming book or tutorial should have a
lot of regular expression stuff in it, though.

Hope this helps,

/* era */

-- 
Bot Bait: It shouldn't even matter whether  (`')  Just  (`')  http://www.iki
I am a resident of the State of Washington   \/ Married! \/   .fi/~era/

<Prev in Thread] Current Thread [Next in Thread>