procmail
[Top] [All Lists]

Re: Pass to perl.

1999-12-05 12:49:38
Here is how I did it once... 

  :0 H # reverse mailheader and extract name
  * ^Subject: get[ ]*\/[^ ]+
  { FILE="$MATCH" }

  #now get the sender's address
  :0 a
  { F=`formail -rtzxTo:` }
   
  # here we pass the F variable to the checkuser script to 
  # see if it's a valid user. Based on the error code returned
  # send an appropriate message. 
  :0 a
  * ! F ?? ^^^^
  {
    RESULT = `$HOME/checkuser3.pl "$F"`
  }

The perl script in this case returns a success or error code, ie. 404,
401, 200 etc... much as I'd get from apache :-)

There may be better ways of doing this though, but it's an example. 

- paul

--------------------- Kudosnet Technologies Inc. ---------------------
pevad(_at_)kudosnet(_dot_)com                                    
www.kudosnet.com            

For value added web hosting and Internet commerce sites
http://kudosnet.com/

NEW: Register 67 character domain names! $59 for 2 years!
FREE PARKING is included! https://secure.kudosnet.com/domain/

---#326 198 East Island Hwy, box 1532 Parksville BC, Canada V9P 2H4---
--------------------------- 1-877-885-8367 --------------------------- 

On Sun, 5 Dec 1999, Jason C. Leach wrote:

hi,

How would I pass something from procmail to purl? Say the To or Subject
field?

Thanks,
J



--
.............
......... Jason C. Leach
...... University College of the Cariboo
... jcl(_at_)mail(_dot_)ocis(_dot_)net(_dot_)
.. http://www.ocis.net/~jcl
.


Debian!Linux!





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