Please Login or Register

Knowledgebase

Manually Editing Email Forwarders

Sometimes it can be helpful or easier to edit email forwarders manually instead of using the cPanel interface, so here is a little snippet about how to do just that.

Warning, when editing config files on your server use caution and ALWAYS create a backup of the file.

Firstly locate the required files using your preferred server file manager, in this example we are using Virtuozzo's file manager.

Virtuozzo filemanager - Editing Email Forwarders Manually.

Find the forwarder domain you wish to edit/add and click the pencil (edit) button.

Within this file (if you have already setup some forwarders) you will find something like the following.

example@xdnet.co.uk: email@xdnet.co.uk

support@xdnet.co.uk: "| /home/user/email/pipe/script.php"

*: :fail: No such person at this address


So lets break this down to understand the syntax.

example@xdnet.co.uk: email@xdnet.co.uk

The above forwarders example@xdnet.co.uk to -> email@xdnet.co.uk

As you may have guessed, the second example forwards the emails to support@xdnet.co.uk to a "pipe" program stored on the server which takes the email and can process it, this is often used in ticket systems (like the one XDnet uses) which take the email and input it into a database for easier management.

One of the benefits of editing the email forwarder or valiases config files is that you can have greater control over how the forwarders work and what is passed to the server command line, some of which cPanel filters out for server security.

When you try to pipe a forwarder in cPanel it removes parameters like "php -q" which can stop the pipe script from working correctly and the easiest solution is simply to edit the file outside of cPanel and add it back in so instead of:

support@xdnet.co.uk: "|  /user/email/pipe/script.php"

It reads:

support@xdnet.co.uk: "| php -q /home/user/email/pipe/script.php"

 

 






Was this answer helpful?
Add to Favourites Add to Favourites   Print this Article Print this Article
Also Read
Rebuild RPM Database (Views: 1216)
Rebuild RPM Database (Views: 1216)

Powered by WHMCompleteSolution

Language:


Web Hosting
Client Login
Web Hosting

Email

Password

Remember Me


Web Hosting
Search
Web Hosting




Follow Us on Twitter