Pipe email to php handler

software development

#1

ok, two questions. i read that piping is possible if i edit the “.procmailrc” file. i am not entirely sure if i set it up right though… i entered the following lines:

fellowship email to phpscript to db

:0

if this is great, lovely, but i do also need some help setting up the php handler. i have no idea how to write a php script that parses an email and then inserts those values into a mysql database. (well actually i do know how to write the inserting into a db part, just not storing parts of an email to various variables.)

thanks so much for the help


#2

Did you find out how to do this?


#3

BluRonin: I’ve done it before, using http://sourceforge.net/projects/eticket

You could download the source and find out how they’ve done it.

I’ve copied in below a support email i received from DH support (thanks Daniel) which explains the process…

Create your .procmailrc file in your home directory. A basic example that
works on DH servers looks like this:

[code]# Empty DH compatible .procmailrc file

Last updated 7/25/2007

PATH=/bin:/usr/bin:/usr/local/bin
MAILDIR=$HOME/Maildir
LOGFILE=/dev/null # specify something else if you want log files
generated
SHELL=/bin/sh

Add your rules here

Catch-all rule for all unmatched email

:0
$HOME/Maildir/
[/code]

And change the file named .forward.postfix to this (the quotes are
necessary):

"|/usr/bin/procmail -t"
http://wiki.dreamhost.com/Procmail

Cheers,
Karl

web design, development & seo by DigitalVibe