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
[email protected]
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 [email protected] 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.
So this is not an answer to the specific question above it is an alternative solution to what this question was trying to accomplish.
FYI, This is on Plesk with MT as the hosting provider. Different servers, different settings YMMV...
Short version. Instead of using an alias under
and creating the .qmail-user there I just went to the specific user under
in that folder is a .qmail file. when I modified that, the outcome is a success.
Thanks to @Dagon for getting me top step back and debug at a higher level!
Cheers,
t.o.