I'm pretty close here, all the examples I have found have been helpful. I can run the PHP from the terminal but cannot get the script to run from a received email.
The part I am missing is getting the incoming email to connect to the qmail alias
for context. the email I am using is
bb3k@thatdomain.com
in the root of the server I created an alias in
/var/qmail/alias
the alias is named
.qmail-bb3k
in the .qmail-bb3k file i have
|/var/www/vhosts/thatdomain.com/cgi-bin/scrapeAttachment.php
running that file directly gives me
./.qmail-bb3k: line 1: syntax error near unexpected token `|'
sending an email to bb3k@thatdomain.com does nothing, the email makes it through, but the PHP script is never run.
everytime the script is modified, qmail is restarted (not sure if that is necessary.)
i can get the PHP script to run by modifying the .qmail-bb3k script to
php /var/www/vhosts/thatdomain.com/cgi-bin/scrapeAttachment.php
which works when run from the terminal, which we already knew, but quadruple checking doesn't hurt
the links that I've been referencing
http://www.evolt.org/incoming_mail_and_php
http://www.geeksdrafts.net/blog/2011/02/11/sample-qmail-files/
There is enough moving parts that i'm not sure if there is a simple syntax issue or something outside the scope of the bash and php.
any suggestions would be greatly appreciated
t.o.