Postfix email piping

Discussion in 'General' started by Ryanmt, Nov 28, 2010.

  1. Ryanmt

    Ryanmt New Member

    I am trying to create an email pipe so i can use osTicket on my server.
    Code:
    :0 c
    * ^To.*[email protected]
    |/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 [email protected] 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
    [email protected] 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 [email protected] i now get it bounced back
    Code:
    <[email protected]> (expanded from <[email protected]>): unknown user:
        "-q"
    
    <[email protected]> (expanded from <[email protected]>):
        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

    Code:
        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)
     
    Last edited: Nov 28, 2010
  2. falko

    falko Super Moderator Howtoforge Staff

    Can you post the output of
    Code:
    ls -la /var/www/web38/web/support/
    ?
     

Share This Page