Solutions

How to set email piping in Vision Helpdesk?

Sheena Sen May-18th, 2012 19:08 2 0
If you choose pipe method in email queue setup then you will have to set email piping as described below

Email Piping is basically email forwarding where emails are just pushed to parser file from actual email account. Piping is supported by many Mail Transport Agent's includes but not limited to Exim, Qmail, Postfix, Sendmail. MTA's pipes emails to parser and this process is instantaneous.

Piping is instant and efficient method to deliver your emails to parser.

This section covers the steps required for setting email piping on Unix/Linux systems. Windows do not support email piping, for windows you can setup pop3 / imap.

Let's assume you have setup email queue - 'support@yourdomain.com'

Here is how you can setup email piping for various mail servers –

EXIM MAIL SERVER

Open file -- /etc/valiases/yourdomain.com

Assuming that we are setting up support@yourdomain.com, sales@yourdomain.com, billing@yourdomain.com we will create the corresponding entries in the file as follows:

support@yourdomain.com: "|/full_path_to/console/pipe.php"
sales@yourdomain.com: "|/full_path_to/console/pipe.php"
billing@yourdomain.com: "|/full_path_to/console/pipe.php"

Save the alias file and run this command on shell - newaliases -- This will add the alias file.

cPanel use exim mail server and you can set alias from cPanel too -- cPanel >> Mail section Forwarders set --

support@yourdomain.com: "|/full_path_to/console/pipe.php"
sales@yourdomain.com: "|/full_path_to/console/pipe.php"
billing@yourdomain.com: "|/full_path_to/console/pipe.php"

POSTFIX MAIL SERVER

Open alias file: generally its -- /etc/postfix/aliases

You can check what alias file you have on your server -- find line virtual_alias_maps in file /etc/postfix/main.cf

virtual_alias_maps = hash:/etc/postfix/aliases

So based on what is virtual_alias_maps set in main.cf you can edit respective file -- in our case we will consider -- /etc/postfix/aliases

Edit /etc/postfix/aliases and add below lines

support@yourdomain.com "|/full_path_to/console/pipe.php"
sales@yourdomain.com "|/full_path_to/console/pipe.php"
billing@yourdomain.com "|/full_path_to/console/pipe.php"

Save the alias file and run this command on shell - newaliases This will add the alias file.

If you made any changes in main.cf then run command -- service postfix reload

Second method is using .forward file for piping.

1) Open alias file: generally its -- /etc/postfix/aliases

You can check what alias file you have on your server -- find line virtual_alias_maps in file /etc/postfix/main.cf

virtual_alias_maps = hash:/etc/postfix/aliases

So based on what is virtual_alias_maps set in main.cf you can edit respective file -- in our case we will consider -- /etc/postfix/aliases

Edit /etc/postfix/aliases and add below line (This line is for catch-all)

@yourdomain.com accountusername

2) and in /home/accountusername create .forward file with this line

/home/accountusername/public_html/support/console/pipe.php

That's it!

QMAIL MAIL SERVER

Open alias file:

/usr/local/qmail/mailnames/yourdomain.com/support/.qmail

The above alias file is for the email support@yourdomain.com. In certain installations the alias file can also be created as:

Alias File:

/usr/local/qmail/mailnames/company.com/.qmail-support

You should open the above alias files and point them to full path to manage/pipe.php, prefixed with the “|” (Pipe) symbol.

support@yourdomain.com: "|/full_path_to/console/pipe.php"

SENDMAIL SERVER

Step 1: Add an alias in /etc/alias for support email. Be sure to rebuild the alias file after by typing newaliases at the command line.

support: "|/usr/bin/php -q /full_path_to/console/pipe.php"

Step 2: chmod the script so it is executable:

chmod 755 /full_path_to/console/pipe.php

Step 3: Create a symbolic link in /etc/smrsh so sendmail will know about script. If you don't do this then sendmail will give error message Service unavailable, and smrsh:
"php" not available for sendmail programs (stat failed).

cd /etc/smrsh ln -s /usr/bin/php ./php ln -s /full_path_to/console/pipe.php ./pipe.php

Note that if you are installing a script on a virtual site you need to make the above changes in the virtual site files. So instead of adding links in /etc/smrsh you would add them in /home/virtual/siteXX/fst/etc/smrsh and instead of adding the alias in /etc/aliases, you would add them in /home/virtual/siteXX/fst/etc/aliases. Then to rebuild the aliases DB, you need to do this:

/usr/sbin/chroot /home/virtual/siteXX/fst newaliases

Vote

Was this article helpful?
2 out of 3 found this helpful