Email to php script

mvdg27

Verified User
Joined
Oct 25, 2006
Messages
20
Hi,

I'm looking for a way to redirect an e-mail sent to [email protected] to a php script which then will read the e-mail and process it (e.g. editing, forwarding, placing in db).

On the internet I read that this should be possible, but I can't figure out how to set this up with Debian and DirectAdmin.

Can anyone guide me through the process of doing this?

Thanx in advance! -Michiel
 
u could also use the scripting to do the same

php - imap

u can use php or perl(module POP3Client) script (cron it) that can connect to a mailbox, read all the mails, process them and then deleles them at the end.

I have done this for few of the email marketing systems that I have built to check for bounced emails.
 
I'm looking for a way to redirect an e-mail sent to [email protected] to a php script which then will read the e-mail and process it (e.g. editing, forwarding, placing in db).
You can create a pipe as a forwarder, something like this:
Code:
"|/domains/example.com/path/to/script.php"
Jeff
 
I was trying to set this forwarding up as well but I receive errors whenever I try to send an email to the forwarding account:

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

pipe to |/home/admin/domains/domain.net/public_html/support/sources/pipe.php
generated by [email protected]
pipe to |/home/admin/domains/domain.net/public_html/support/sources/pipe.php
generated by [email protected]

I made sure that that is the right file but it doesn't seem like it forwards to it right. I tried putting "|php -q /home/admin/domains/domain.net/public_html/support/sources/pipe.php" or even the full path to php (/usr/local/bin/php -q)


Is there something I have to do to make it possible for emails to forward to PHP scripts?
 
Have you checked your exim log? It should be giving you more information.

Jeff
 
2007-06-26 11:26:21 1I3Drx-0002ax-0T ** | /home/admin/domains/domain.net/publl
ic_html/support/sources/pipe.php ([email protected]) <[email protected]> R=virtual_aliases T=virtual_address_pipe: Child process of virtt
ual_address_pipe transport returned 127 (could mean unable to exec or command doo
es not exist) from command: /home/admin/domains/domain.net/public_html/supporr
t/sources/pipe.php
 
/home/admin/domains/domain.net/public_html/supporrt/sources/pipe.php

or

/home/admin/domains/domain.net/publlic_html/support/sources/pipe.php

Please check the logs, it seems like that the paths are not set properly? Is it your typo?

Check if exec is been disabled in php.ini (disabled_functions)
 
I think that was just the log file that duplicated the letters. It seemed to put publlic too, but it was right in the forwarder.


I couldn't find any disabled_functions in my php.ini, would they be under a certain section?
 
Back
Top