You are here: Re: [PHP] Using aliases to have an email trigger a php script « PHP « IT news, forums, messages
Re: [PHP] Using aliases to have an email trigger a php script

Posted by Curt Zirzow on 10/03/49 11:37

On Sat, Jan 14, 2006 at 11:55:20AM -0500, Sean Lerner wrote:
> Hello,
>
> I'd like an email received to toronto@washroomquest.com 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
> system_aliases:
> driver = aliasfile
> ...
>
> 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");
> fclose($var_toronto_file);
> ?>
> ...
>
> A few things I've tried:
> * changed the permissions to 777 in toronto.txt and email_toronto.php to
> rule out a permissions issue

This as you checked would be the first guess. Second guess is what
is the current working directory this piped script runs at?

Third, although probably should be the first one, consists of a few
things:
1. try using an abolute path to fopen()
2. check the result of fopen, like the example of
http://php.net/fopen
3. have your script error_log() ([1] assuming your php.ini:error_log
setting is at syslog) some debug messages and look in
/var/log/messages (or where the error_log directive specifies)


If that doesn't work and your current working directory is where it
should be then some help from an exim list might be useful. I'm
rather new to configuring exim.

[1] http://php.net/manual/en/ref.errorfunc.php#ini.error-log

Curt.
--
cat .signature: No such file or directory

 

Navigation:

[Reply to this 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

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