Can I configure email piping through ISPConfig3

Discussion in 'General' started by atjensen11, Jan 17, 2010.

  1. atjensen11

    atjensen11 New Member

    I have been testing osTicket as a Support Ticket system. It allows for automated support ticket creation when users send emails to a specified email address.

    I already have the mailbox created in ISPConfig3. Some examples are supplied in the osTicket WIKI.

    Is there a way to do the piping through the ISPConfig web GUI or do I need to get into Postfix master.cf file?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You can pipe the message to osTicket by adding a pipe in the custom rules field of the mailbox. The rules have to be in maildrop syntax. I guess something like:

    to "|/path/to/api/pipe.php"

    should work.
     
  3. pebkac

    pebkac Member HowtoForge Supporter

    did this work for you, I too am trying this.

    I get this when I test it, and not sure why. I made sure pipe.php is chmod 777 and still errors out????
     
    Last edited: Jan 27, 2010
  4. pebkac

    pebkac Member HowtoForge Supporter

    I also made sure the dir leading to pipe.php are permission 777, and still nothing,

    Code:
    The mail system
    
    <[email protected]>: Command died with status 126: "/usr/bin/maildrop".
       Command output: ERR: authdaemon: s_connect() failed: Permission denied sh:
       /var/www/mydomain.com/web/helpdesk/api/pipe.php: Permission denied
    
    Final-Recipient: rfc822; [email protected]
    Original-Recipient: rfc822;[email protected]
    Action: failed
    Status: 5.3.0
    Diagnostic-Code: x-unix; ERR: authdaemon: s_connect() failed: Permission denied
       sh: /var/www/mydomain.com/web/helpdesk/api/pipe.php: Permission denied
    
    Code:
    drwxrwxrwx 10 web1 client1       4096 2010-01-26 20:32 helpdesk
    drwxrwxrwx 2 web1 client1 4096 2010-01-26 21:34 api
    root@pebkac:/var/www/mydomain.com/web/helpdesk/api# ls -l
    total 28
    -rwxrwxrwx 1 web1 client1 3023 2010-01-26 20:23 api.inc.php
    -rwxrwxrwx 1 web1 client1  716 2010-01-26 20:23 cron.php
    -rwxrwxrwx 1 web1 client1   34 2010-01-26 20:23 index.php
    -rwxrwxrwx 1 web1 client1 4971 2010-01-26 21:34 pipe.php
    
    :confused:
     
  5. edge

    edge Active Member Moderator

    What exactly did you add in the "custom rules field of the mailbox"?
     
  6. pebkac

    pebkac Member HowtoForge Supporter

    Code:
    to "|/var/www/mydomain.com/web/helpdesk/api/pipe.php"
     
  7. edge

    edge Active Member Moderator

    Thank you for the info.
    For me it's working great.

    I've chmoded my pipe.php to 755.
    It's owned by (in my case) web81

    As test I added a small "email me when script is hit" option, and after sending the email to the "custom ruled mailbox", I got a reply from my "email me when script is hit" .
     
    Last edited: Jan 27, 2010
  8. pebkac

    pebkac Member HowtoForge Supporter

    You're lucky I guess. What server it is it running on. I cannot figure this out for the life of me.
     
  9. edge

    edge Active Member Moderator

    Debian Lenny with ISPconfig3

    Not sure if it makes any difference, but my "pipe.php" script starts with:

    Code:
    #!/usr/bin/php 
    <?php 
    ....
    rest of code....
    ....
    ?>
    
     
  10. pebkac

    pebkac Member HowtoForge Supporter

    Same here.

    UPDATE: Mine actually looks like this:
    #!/usr/bin/php -q

    I iwll try it without the -q and see what happens.
     
    Last edited: Jan 28, 2010
  11. pebkac

    pebkac Member HowtoForge Supporter

    still does fails without the -q
     
  12. edge

    edge Active Member Moderator

    Also..
    I'm using cients ID's in the path, and not the domain.
    Maybe this witll make it work for you?

    Code:
    to "|/var/clients/client1/web81/web/helpdesk/api/pipe.php"
     
  13. pebkac

    pebkac Member HowtoForge Supporter

    Good try, appreciate it. However, it still fails. This is driving me batty..I'm searching all over for a solution....
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    And your pipe.php is really a shell script and not not just a php file? Post the first line of the pipe.php script.
     
  15. pebkac

    pebkac Member HowtoForge Supporter

    #!/usr/bin/php -q
    <?php
     
  16. pebkac

    pebkac Member HowtoForge Supporter

    Got it working by running this

    chmod o+x /var/www/clients/client1/web1/web

    Not sure why that was needed but it works now.
     
  17. bluebirdnet

    bluebirdnet Member

    with WHMCS i put the following in Custom Rules;

    Code:
    to "| php -q /var/www/whmcs/pipe/pipe.php"
    dont forget the to before quotes!

    And chmod 755 pipe.php or else you get a permission denied.
     
  18. bluebirdnet

    bluebirdnet Member

    LOL i was setting a new server and had a "Permission denied" with Maildrop and search the Internet and came back to this post.

    So as PebKac mentioned above, if your trying to pipe WHMCS you need to;

    chmod o+x the "/web" directory.

    then chmod 755 pipe.php

    and setup the pip in Custom Rules as such;

    to "| php -q /var/www/clients/client1/web1/web/pipe/pipe.php"


    hope this helps someone! i helped myself anyhow.

    cheers.
     
  19. Hi Till
    In my case i use Multi Server Setup with my email server on a different host other that my web server hosting my osticket software. I did not copy the pipe.php as use in this discussion as i am sure it is for local piping. In my case i think it is remote email piping ... i have google and look around but no luck of , and finally i come across this post, I hope someone would help solve this issue for me as it is several days now with no luck.
    cheers
     
  20. Till
    any response to my previous post regarding remote piping
     

Share This Page