procmail
[Top] [All Lists]

Re: I am looking to do these tasks...

1996-02-12 20:33:14

In reverse order given...

Darin Stanchfield <darin(_at_)ktb(_dot_)net> writes:
task 2:

second, in a whole different recipe, I want to read the address from the
file.  Again, there is only one address in it and that is all...


ADDRESS=`cat file_with_address_to_slurp_in`


task 1:

first, I want a condition to check to see that the recepients address is in
a in the file.  There will only be 1 address in the file, so if the
recepients address isn't there, the recipe shouldn't run.


ADDRESS=`cat file_with_address_to_slurp_in`

:0
*       $ ^From:.*$\ADDRESS
{
        # Do whatever
}

Don't forget to a) use the dollar sign on the condition line, otherwise
$ADDRESS won't be expanded, and b) put the form of the address in the
file that normally appears in the "From:" field (or whatever field you
end up matching against).  I though in the '\' on the expansion of
address to avoid strangenesses with regexp meta-charaters (like '.' and
'<>') in the address.


Philip Guenther

----------------------------------------------------------------
Philip Guenther                 UNIX Systems and Network Administrator
Internet: guenther(_at_)gac(_dot_)edu   Phonenet: (507) 933-7596
Gustavus Adolphus College       St. Peter, MN 56082-1498
Source code never lies (it just misleads).  (Programming by Purloined Letter?)

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