procmail
[Top] [All Lists]

Re: automatic PHP script ?

2003-02-27 13:26:30
I dunno if this will help, but I have all my paypal emails simply
forwarded procmail on one server:

MAILDIR=$HOME/mail
DEFAULT=$HOME/mail/inbox

LOGFILE=$HOME/.proclog
LOG="
"

VERBOSE=yes
:0B:
* for \/.*
{
        :0c
        | php -q $HOME/bin/paypal.php "$MATCH"

        :0
        inbox
}

That's very specific tho, it's for when my site receives donations, I have
one mail with some text line:

procmail: Assigning "MATCH="
procmail: Matched "$10.00 from Name Here (email(_at_)domain(_dot_)com)"
procmail: Match on "for \/.*"
procmail: Extraneous locallockfile ignored
procmail: Locking ".lock"
procmail: Unlocking ".lock"
procmail: Assigning "LASTFOLDER=php -q /home/username/bin/paypal.php
$10.00 from Name Here (email(_at_)domain(_dot_)com)"
procmail: Assigning "LASTFOLDER=inbox"
procmail: Opening "inbox"
procmail: Acquiring kernel-lock
procmail: Executing "php,-q,/home/username/bin/paypal.php,$10.00 from Name
Here (email(_at_)domain(_dot_)com)"
procmail: [10468] Mon Feb 24 19:01:48 2003
procmail: Notified comsat: "username(_at_)51828261:/home/username/mail/inbox"
From payment(_at_)paypal(_dot_)com Mon Feb 24 19:01:46 2003
 Subject: Notification of Payment Received
  Folder: inbox
2111

My script just shoves the formatted info into an sql db so it appears
immediately on the site "contributions" page.

Neat! I think in your case you have some perms problems.

And yes - if you (sorry, WHEN you) see improvements on the code I use it
would be nice to see it :)

I don't think I figured out how to read

echo "hello" | php -q script.php so I had to use $@ array instead.
Poff

poff(_at_)sixbit(_dot_)org
SDF Public Access UNIX System - http://sdf.lonestar.org


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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