procmail
[Top] [All Lists]

Re: setting variables in a procmail script?

1999-05-08 23:51:40
John Conover <conover(_at_)inow(_dot_)com> writes:
Is there a way of setting FROM without the operations on the
intermediate files?

   :0
   * ^something
   {
       :0 whc :tmp.FROM
       | formail -rtz -xTo: > tmp.FROM
      FROM=`cat tmp.FROM`

There are two:

        :0 wh
        FROM=| formail -rtzxTo:

        FROM = `formail -rtzxTo:`

When procmail performs a command substitution ("backquote expansion")
it provides to the invoked command the entire message on it's stdin.
On the otherhand, the "var=|" action type obeys the 'h' and 'b' flags
and only feeds the requested parts (defaulting to both, of course).

One other footnote of interest: backquote expansions take place in a
buffer of LINEBUF length; output beyond that will be dropped and
procmail log the warning "Excessive output quenched".  "var=|" actions
have no such limitation: procmail will use the same algorithm as it
uses to read the message itself, so that system memory is the limit.


Philip Guenther

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