procmail
[Top] [All Lists]

Re: passing MATCH

1999-08-21 10:41:47
On Fri, 20 Aug 1999, David W. Tamkin wrote:

dt> | 
dt> | can I use TO_ in that, or should I list all the headers to check?
dt> 
dt> List them all.  ^TO_ works in procmail regexp condition lines, not as an
dt> argument to any formail options.

  Thought that would be the case, thanks for clarifying that :)

dt> or if a condition line containing the \/ extraction operator is tried and 
the
dt> expression matches (even if the condition is negated and thus, as a whole,
dt> fails).  Otherwise it won't be set.

  Learning how the \/ extraction operator works is going to be my next project.
I'm still confused on it, but once I start playing with it, it should help. It's
probably what I'm actually looking for now though.

dt>  :0h
dt>  * ? test -f $MAILINGLISTS
dt>  LISTADDRESS=| formail -zx To: -x Cc: -x Resent-To: -x Resent-Cc: -x'From ' 
\
dt>                -x Sender: -x Resent-Sender: | grep -if $MAILINGLISTS
dt> 
dt>   :0a: # note a, not A; previous condition must match AND previous action
dt>        # must succeed
dt>   $LISTADDRESS
dt> 
dt> Of course it will still bomb if the header line with the list address
dt> contains additional text.  What you really need is to find the line in
dt> $MAILINGLISTS that appears within an address line in the headers.

  Thats about how I rewrote it, the only thing missing now is instead of
the header line being saved to LISTADDRESS, I'm looking to save the line
that grep is searching for, that way I can save it to that particular 
folder if there happens to be a match. For example, grep is searching for 
address(_at_)mailing(_dot_)com and finds it in one of the headers. I want to 
have it  
then run on the following

:0a
$LISTADDRESS

-- 
     S.Toms - tomas(_at_)primenet(_dot_)com - http://www.primenet.com/~tomas
                S.u.S.E. Linux v6.1+ - Kernel 2.2.11

Blood is thicker than water, and much tastier.

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