PDA

View Full Version : Postfix email piping


Ryanmt
28th November 2010, 12:55
I am trying to create an email pipe so i can use osTicket on my server.

:0 c
* ^To.*support@domain.com
|/var/www/web38/web/support/automail.php


Ive tried putting it in

/var/www/web38/user/web38_support/.procmailrc
/var/www/web38/.procmailrc

and restarted postfix and its not working. There is a support@domain.com email setup so I assume any mail thats sent to it is still ending up in the inbox rather than getting piped.

What is the correct way to do this?

Thanks
Ryan

-edit

I also did a bit of searching on here and had ago at doing it with aliases. Im not sure if this will work since the script needs to know which email address it was sent to. It uses things like
33423support@domain.com to attach things to ticket 33423 as far as i can gather.

i added

web38_support: | php -q /var/www/web38/web/support/automail.php

to /etc/aliases and ran sudo newaliases

if i send an email to support@domain.com i now get it bounced back

<-q@vps.co.uk> (expanded from <support@domain.com>): unknown user:
"-q"

<web38_support@vps.co.uk> (expanded from <support@domain.com>):
cannot append message to file /var/www/web38/web/support/automail.php:
cannot open file: Permission denied


also if i chmod or chown the file to root and 777 etc i get

cannot append message to file /var/www/web38/web/support/automail.php: file
is executable




I have also tried

web38_support: "|php -q /var/www/web38/web/support/automail.php"
web38_support: |/var/www/web38/web/support/automail.php
web38_support: root, "| php -q /var/www/web38/web/support/automail.php"
with either the same error or no error atall (still doesnt work)

falko
29th November 2010, 13:05
Can you post the output of ls -la /var/www/web38/web/support/?