Page 1 of 1

How to pipe all incomming mails to php script ?

Posted: Tue Aug 19, 2003 6:39 am
by kadam
hello everybody,

Anybody helps to solve this problem.

I have to pipe all incomming mails to PHP script.

For this I tried variour options.

1) I make .forword file and write as:- "|/our/script.php"

This file installed on domains home directory.
This is not working so I tried another.

2) I make .qmail file and and write as:- |/our/script.php

but any of this is not working. All the mails directly goes to mailbox
and can not pipe to script.

Is their any other procedure or anything is missing from my side to rectify
this problem.

I have following configuration.
==============================================

Path to send mail = "/usr/sbin/sendmail"
Path to Php Cgi = "#!/usr/bin/php"

==============================================

Please help me.

satish

Posted: Tue Aug 19, 2003 7:12 am
by greenhorn666
You are using qmail or sendmail as smtp?

Still I don't know about these two, but in exim you have to allow pipes in .forward
You should check your MTA's documentation for how to do this
(enable pipes in .forward or configure a transport for a specific localpart)

Posted: Tue Aug 19, 2003 7:44 am
by twigletmac
Please don't cross-post. If you feel you have posted in the incorrect place then say so, don't just post another topic with the same question.

BTW, I have moved this to the Miscellaneous forum as it is not a PHP theory or design discussion topic, nor is it a client side issue.

Mac

Posted: Tue Aug 19, 2003 9:21 am
by DaMastaBugz
I had a similar situation and I resolved it by creating a script I ran in PHP that would fetch the e-mails automatically.
The Imap is pretty straight forward to understad in PHP and you should have no problems with that, for the automatic script running, add either wget or lynx to your crontab.

It worked like a charm. And the load on the server was greatly reduced.
If you have a situation such as we did (where we had to process only certain e-mails) then this is the tool for you.