Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Remote Piping vs Local Piping

I Checked the other BIG thread on this in the forum and it seemed to be all about LOCAL Piping which as you can no doubt tell doesnt seem like it is going to help me here.

How do I set up Remote Piping?
I found automail.php in the scripts folder that comes in the distro....
1. Where do I put automail.php?
2. Do I need both automail.pl AND automail.php?
3. How to I run automail.php on a regular basis? If cron job how do I set that up with cPanel?

Comments

  • peter;746 said:

    I will put some instructions on the wiki when I get time. Remote piping is setup just like local piping. The script simply redirects the piped email via HTTP to osTicket pipe handler.

    *Upload it to your mail server (remote host)...directory of your choice.
    *Make sure it is executable
    *White list the IP address of the remote host ( admin panel api settings )
    *Set the pass phrase ( admin panel api settings )
    *open the script and enter osTicket's url ( pipe interface) and API pass phase.
    *Setup email forwarding ( see wiki and search the forum). It is same as setting up local piping.
    So you are saying that the automail.php or .pl needs to run on my mail server (a different remote server from my osTickets deployment) and that will make my mail server "deliver" the mail directly to the osTickets system, as if it were being entered "manually" via the web interface?
  • gfdos.sys;758 said:
    So you are saying that the automail.php or .pl needs to run on my mail server (a different remote server from my osTickets deployment) and that will make my mail server "deliver" the mail directly to the osTickets system, as if it were being entered "manually" via the web interface?
    Yes automail.php/pl is meant to be used by remote host to "deliver" mail to osTicket via HTTP post (mail = raw email). osTicket will parse the raw email and create a ticket. Web interface is not utilized.

    At the moment we have four possible ways of creating tickets;
    • Web interface [clients web form]
    • POP3 [osTicket fetches the emails]
    • Pipe (local and remote) [MTA "delivers" mail to osTicket]
    • Staff [phoned in tickets..etc]
  • For example?

    This is a work in progress, but is this what you mean?

    For Remote Piping:
    On osTicket:
    1. Set API pass phrase, and white list the IP of the remote Mail server

    On Remote Mail server:
    (php must be installed)
    2. install automail.php on mail server in /path/to/automail.php
    3. Go into mail setup and forward [email]support@domain.com[/email] to
    "|/path/to/automail.php" or "|/usr/bin/php -q /path/to/automail.php"
    WHERE: /path/to... and /usr/bin.. is located ON that remote mail server (not on osTicket Server)
  • Yes that is all you need to do. Note that you can use automail.pl instead of automail.php since most server installations come with perl installed.

    Please keep your notes. If need be I can help with the setup email/IM/PM me.
  • Zimbra (Postfix MTA)

    I am using Zimbra as my mail solution. It doesnt use sendmail, qmail, nor cpanel, it uses Postfix as the MTA.

    here is a link to where I posted my problem on their forums.

    http://www.zimbra.com/forums/administrators/14475-forwarding-mail-pipe.html

    If you know how to set this up with postfix, that might work tho.

    Thanks,
    Gabe
  • More info please?

    Okay so, I think I'm getting somewhere...

    I set it up and sent a test email message.
    Nothing was comming in to the osTickets "queue" as a new ticket, but I noticed I was getting an email:

    Subject:API Error(s)
    Unknown remote host [xxx.xxx.xxx.xxx]

    the remote host ip was not the one I had set up -- I had mistyped it.

    I went in and reset the API, then reentered the pass phrase and entered the correct ip. I double checked the pass phrase matches the one I entered in automail.php.

    Now when I send the email NOTHING is happening....
    I only KNOW it was recieving ANY thing from the pipe because every time I would send a request I would get an API error(s) mail like above....

    SO I think the stuff is getting through just not routing some how correctly in osTicket.
    Is there some sort of log I can check on the osTicket side to see WHY nothing is happening:
    Will it show if email is being recieved from the remote piping?
    Will it show why it isnt being properly redirected?

    HELP!
  • I am getting the same problem, I know that automail.pl is running as I can see it form the server logs, and in the web logs of the osTicket machine. However in the web logs it returning a 400 error.

    I get no error emails, but like you if I change the IP address of the whitelisted machines then it send me an error alert.

    Ben
  • OK,

    I have fixed this, the user agent is set to the md5 of the api key, only it needs to use md5_hex() not md5() in the script.

    So two changes needed :

    use Digest::MD5 qw(md5_hex);

    and

    $ua->agent(md5_hex($config{'key'}));

    Regards

    Ben
  • Ben,

    Thank you! I will look into why 'Invalid API Key' email is not being sent out.
  • Peter,

    The reason is the web server is not even calling the php, the binary from the md5() call is screwing up the HTTP headers, which is why it needed the md5_hex() so it sends just an ascii key instead of binary.

    Regards

    Ben
Sign In or Register to comment.