Remote Email Piping

Remote email piping can be used when wanting to use email piping, but the email account exists on a different server to the SupportPal installation. For example, your email server may be separate to your web server, where remote email piping would be useful.

  1. Go to Settings -> Tickets -> Departments, and either add a new department by click Add Department, or edit a department's email settings by clicking the name of the department or the pencil icon at the end of the row on which the department name is listed.
  2. On the Add Department or Edit Department screen, scroll down to Email Accounts. Make sure that Remote Email Piping is selected from the drop down menu next to Email Support. Enter the email address you would like to to use for email piping.
  3. Download the remote email piping script from our downloads area. Open the included file remote_pipe_handler (no extension) and edit line 19, replacing the example URL with the URL to your system URL followed by 'remote_pipe'.
                $pipeUrl = '';
    To use 'Consume All Email' edit line 22, replacing null with a valid department email address. If you need to specify multiple consume all addresses, then we recommend to create multiple copies of the remote_pipe_handler file and set different $intended addresses:
               $intended = null;
    Upload this file to the server with the email accounts on it.
  4. Set-up an email forwarder on your server. It should be called whenever an email is received by the mail server.

    If PHP is not found on the system path, an error will be returned when you type "php" in SSH. Once you locate the PHP executable, make sure to include that in the Remote Email Piping command. So, if PHP is located at /usr/bin/php, you would write, for example:
               | /usr/bin/php -q /var/www/support/remote_pipe_handler
    php -q is the PHP command to execute a PHP script from the command line.

Common Problems

Local Delivery Failed Error Message

If you receive a bounce email containing an error that states local delivery failed when sending an email to your piped address then the forwarder entry is not correct and the message is not being sent to the pipe script.

   pipe to |/var/www/remote_pipe_handler generated by [email protected] local delivery failed

To correct this, first ensure the remote_pipe_handler file permissions are set to chmod 755.

Example: Setting Up Remote Email Piping on cPanel

  1. Edit the URL in the remote_pipe_handler file as described above and upload to a known location inside the public_html folder, in our example we're uploading to public_html/folder/remote_pipe_handler.
  2. Set the remote_pipe_handler file to CHMOD 755.
  3. Login to your cPanel account and click Forwarders under the Email section.
  4. Click Add Forwarder and type in the address you wish to forward, for example 'support' for '[email protected]'.
  5. Click Advanced Options, select the Pipe to a program option and type in the path to the file, in our example public_html/folder/remote_pipe_handler, then click Add Forwarder.
  6. Save the department with the email address entered and the email support set to Remote Email Piping.