procmail
[Top] [All Lists]

formail options

1998-05-04 23:39:06
Okay, I keep trying to learn procmail but the output of certain things
just doesn't seem to match what the man page says.  Please forgive me
if I seem a little bit irreverent below.  I'm just a beginner still.
For example, below is a simple variable assignment from an old script
by Tim <bodysurf(_at_)pobox(_dot_)com>:

FROM=`formail -rzxTo:`        

It gives us, according to what I understand, the address in 
the From-space line.

For the first option, formail's man page says:

     -r    Generate an auto-reply  header.   This  will  normally
          throw  away all the existing fields (except X-Loop:) in
          the original message, fields you wish to preserve  need
          to  be  named  using  the   -i option.  If you use this
          option in conjunction with -k, you can prevent the body
          from being `escaped' by also specifying -b.

Well, why do we need an auto-reply header?  We're just trying to
get the From-space address, right?

Secondly:

     -z    Ensure a space exists between field name and  content.
          Zap fields which contain only a space.  Zap leading and
          trailing whitespace on fields extracted with -x.

Hmmm.  Well, that seem too useful for what we're doing and it sure
doesn't teach me much and since I know a dozen programming languages 
(or so I did), I must must be too dense.

Lastly:

     -x headerfield
          Extract the  contents  of  this  headerfield  from  the
          header, display it as a single line.

What?  The To-colon line?  Correct me if I'm wrong but I thought 
we were trying to get the From-space line.

Perplexed,

Dave Robbins

===========================================================================
===  Nuremberg Laws are in place in America ... if you're a single dad  ===
===========================================================================
===  1935 (Sep 15) Nuremberg Laws deprive German Jews of citizenship    ===
===========================================================================

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