Reply to Using aliases to have an email trigger a php script

Your name:


Posted by Sean Lerner on 01/14/06 18:55


I'd like an email received to to trigger a
php script.

I've configured the following:

in /etc/aliases
toronto: |/var/www/wq/email_toronto.php

in /etc/exim/exim.conf
driver = aliasfile
file_transport = address_file
pipe_transport = address_pipe
file = /etc/aliases
search_type = lsearch
user = mail

in /var/www/wq/email_toronto.php
#!/usr/bin/php -q
$var_toronto_file = fopen("toronto.txt", "a");
fwrite($var_toronto_file, "Email Received!\n");

I then send an email to and check the file
toronto.txt but it does not say Email Received!

The exim log shows:
2006-01-13 13:38:12 1ExToS-0007Ni-00 <=
[] P=esmtp S=758
2006-01-13 13:38:12 1ExToS-0007Ni-00 => |/var/www/wq/email_toronto.php
<> D=system_aliases T=address_pipe
2006-01-13 13:38:12 1ExToS-0007Ni-00 Completed

There's nothing in the panic log or syslog.

A few things I've tried:
* changed the permissions to 777 in toronto.txt and email_toronto.php to
rule out a permissions issue
* changed in systems_aliases user=root
* put the script in /etc/smrsh (even though I don't think I'm running
smrsh on my server)

Any idea as to why my script isn't being triggered by the email? Any
further logs I can check?



[Back to original message]

Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация