For cPanel & WHM 11.48
(Home >> Mail >> Forwarders)
You can use this interface to forward copies of one address's incoming emails to another address. This allows you to use one account to check mail for several email addresses. You can also discard email or send (pipe) mail to a program.
To view forwarders for a specific domain on your account, select the domain for which you wish to set forwarders from the Managing menu.
Email Account Forwarders
The Email Account Forwarders table lists all of the email accounts for which you have configured forwarding.
- To quickly find a specific email address, enter a keyword in the Search text box and click Go.
- To view the route that a forwarded message takes, select Trace in the Functions column for that email address.
- To delete a forwarder, click Delete in the appropriate row. Click Delete Forwarder to confirm that you wish to delete that 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 email.
- Select one of the following options:
- Forward to email address — Select this option to forward mail to another address. Enter the address to which you wish to forward mail in the text box.
- Discard and send an error to the sender (at SMTP time) — Select this option to discard incoming messages 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 mail to a system user. Enter the appropriate username in the text box.
- This text box accepts the username of any user on the server.
- System accounts do not have a public-facing email address.
Pipe to a program — To automatically forward messages to a program, define a path to the program (for example,
/home/$utility) in the text box. For more information, read the Pipe to a Program section below.
Discard (Not Recommended) — Select this option to discard incoming messages without a failure notice.
Important:We do not recommend this option, because the sender will not know that the delivery failed.
- Click Add Forwarder.
- If you do not delete the cPanel account for which mail is forwarded, both accounts will receive mail.
- If you wish to forward mail to another account but not receive mail at your cPanel account, create a forwarder from an address that does not have a cPanel account.
- If the account already exists, delete it in cPanel.
- The system will forward all of the mail that you receive to the destination that you configure in this interface.
Pipe to a Program
Make sure that your script uses the proper file permissions (
0700). To change your script's file permissions, run the
chmod 0700 myscript.php command, where
myscript.php stands for your script's location and file name.
You can use the Pipe to a Program option to parse and enter email information into a different system. For example, you can use the Pipe to a Program option to pipe email information to a program that enters email information into a ticket system.
STDINpipes email and headers to the program.
Pipes can accept variables from the
$_SERVERarray and variables on the command line.
- 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.
When you use the Pipe to a Program option, enter a path that is relative to your home directory. For example, if your username is
user and you wish to use the
script.pl script, enter
test.pl in the Pipe to a Program text box.
If you use PHP, ensure that you appropriately wrap your code in start and end tags.
PHP and Perl hashbangs
To ensure that the script will function properly, the script must be executable and the appropriate hashbang line must exist at the top of the script.
If you use PHP, use the following hashbang line at the top of the script:
If you use Perl, use the following hashbang line at the top of the script:
If your script does not include a hashbang, enter the path to the Perl or PHP interpreter in the Pipe to a Program text box. Follow it with the full path to the script, as in the following examples:
You can use domain forwarders to forward copies of all of the incoming mail for all of a domain's addresses to another domain. Domain forwarders override the default address for the forwarded domain.
Domain forwarders only forward mail when a delivery is not successful. For example, if a user sends an email to
email@example.com, the following actions might take place:
firstname.lastname@example.org an existing email address or autoresponder, cPanel will not forward the email.
email@example.com not an existing email address or autoresponder, cPanel will forward the email.
Delete a domain forwarder
To remove a domain forwarder, click the button in the Delete column that corresponds to the domain forwarder that you wish to remove.
Add Domain Forwarder
To add a domain forwarder, perform the following steps:
- Click Add Domain Forwarder.
- Enter the domain to which you would like to forward email.
- Click Add Domain Forwarder.