Knowledge Base
How to Configure Email Forwarders in cPanel
When you want emails to be automatically redirected. This article explains how to configure email forwarders in cPanel.
This interface allows you to configure an email address to forward copies of incoming emails to another address. This is useful if, for example, you want to use one email address to check emails addressed to multiple accounts. You can also discard email or send (pipe) email to a program.
Add Forwarder
To add a mail forwarder, perform the following steps:
-
Click Add Forwarder.

-
In the Address to Forward text box, enter the address for which you wish to forward incoming email.

-
Select the desired domain from the menu.
-
Select one of the following options:
-
Forward to email address — Select this option to forward incoming email to another address. Enter the address to which you wish to forward email in the text box.

-
Discard and send an error to the sender (at SMTP time) — Select this option to discard incoming email and automatically send a failure notice to the sender. Enter the desired failure message in the Failure Message text box.

-
Click Advanced Options to view the following additional options:

-
-
Forward to a system account — Select this option to forward incoming email to a system user. Enter the desired username in the text box.
-
Pipe to a program — To automatically forward incoming email to a program, enter a path to the program, relative to the account's home directory in the text box.
-
Discard (Not Recommended) — Select this option to discard incoming email without a failure notice. We do not recommend this option, because the sender will not know that the delivery failed.
Pipe to a Program

- Use the Pipe to a Program option to parse and enter email information into a different system. For example, use the Pipe to a Program option to pipe email information to a program that enters email information into a ticket system.
- When piping to a program, you should enter a path relative to your home directory. For example, to use the /home/user/script.php script, enter script.php in the Pipe to a Program text box, where the user represents your username.
- If the script requires an interpreter such as Perl or PHP, you should omit the /usr/bin/perl or /usr/bin/php portion. Make sure that your script is executable and has the appropriate target at the top of the script. If you do not know how to add the hashbang, just make sure to name your script file with the correct extension and you will be prompted to have the hashbang added automatically.
Note
-
The language or environment that you use may cause memory limit issues.
-
If your script produces any output, even a blank line, the system will create a bounce message that contains that output.
-
If you use PHP for your pipe script, make certain that you appropriately wrap your code in start and end tags.
Add Domain Forwarder
Domain forwarders send copies of all of a domain's incoming email to another domain. Domain forwarders override the default address for the forwarded domain.

To add a domain forwarder, perform the following steps
-
Click Add Domain Forwarder.
-
Enter the domain to which you want to forward email.
-
Click Add Domain Forwarder.

Delete Domain Forwarder
To remove a domain forwarder, click Delete next to the domain forwarder that you wish to remove, and then click Delete Domain Forwarder to confirm.
Did you find this article helpful?