• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

Pipe Incoming Email to PHP or PL script

S

sandersii

Guest
I know this isn't a new thing and I've done a significant amount of digging to find a solution, of which I can't get the full script with dot-qmail file to work properly.

I've have the /mailnames/<emailname>/.qmail file with the following:

| preline /var/www/vhosts/domain/script/emailproc.pl
| preline /var/www/vhosts/domain/script/emailproc.php
| /usr/bin/deliverquota ./Maildir

and in both the Perl and PHP script files contain a simple print(MYFILE, "test text\n"); and fwrite("test text\n","a"); respectfully. Both have chmod 755. When I run either one from the CLI they do as intended, write a new line to the file, however when an email is sent to the <emailname> it doesn't write the to the file, but I do receive the email in the inbox.

I'm stumpped on why I can run them from the CLI just fine, but they don't seem to be firing whith the .qmail file. If I make a false entry on the file location in the .qmail file I do receive the error notice, so I know that .qmail file is being called correctly.

Any ideas or help would be extremely helpful
 
Just a thought if you still haven't resolved this... if you are still getting the email in the inbox it is probably because you did not remove the mailbox line from the dot.qmail file... the only lines in the file should be your pipe to script.

The dot.qmail file is what tells qmail where and what to do with the incoming mail messge.
 
Back
Top