Using the E-mail forwarding option with cPanel

cPanel tutorials & how to guides
Finding your way around
your cPanel hosting account

Forward emails to another address

Updated: January 19, 2023
By: RSH Web Editorial Staff
cPanel Tutorials Forwarders
Menu

Email > Forwarders

E-mail Forwarding
This allows you to forward an e-mail from your domain e-mail address to another e-mail address. For example, you can use your personal e-mail address (your-name@your-domain.com) to forward any e-mail to your Gmail, Hotmail etc. address and vis-versa.

With this cPanel feature, it will allow you to set up and configure an e-mail address to forward incoming e-mails to another e-mail address automatically.

This is useful if you need to use one e-mail account to receive e-mails addressed to multiple addresses without having an account for each one.

Plus multiple e-mail addresses can receive the same e-mail message. You can set the account to discard e-mail or pipe (send) e-mail to a program.

This feature is only available if your hosting provider enables it.
This is not the BoxTrapper forwarding documentation. To manage Forwarders for Email Accounts that needs the BoxTrapper feature use the BoxTrapper Forward List feature.
Wildcard Redirect - A wildcard redirect will redirect all e-mails whose addresses match a regular expression (regex) pattern.
You can not configure a wildcard redirect in the Forwarders interface. To learn more about wildcard redirects, read our Global Email Filters documentation.

Email Forwarders

To manage forwarders for a specific domain name on your account, select the desired domain from the Managing menu list.

forwarders

The Email Account Forwarders will lists all the e-mail addresses that use a forwarder to redirect e-mail to another address or service.

To quickly find a specific e-mail address, enter a keyword in the Search box.

To view the route that a forwarded e-mail takes, click Trace in the "Functions" column next to that e-mail address.

If the Web Server uses third-party mail service, such as MailScanner, this feature will return invalid results.

To delete a forwarder, click Delete next to that e-mail address

To change a forwarder, you must delete the e-mail address. Then, follow the steps in the Add Account Forwarder section as shown below.

Note If a forwarder shares an address with an e-mail account, both will receive mail.
To stop receiving e-mail at the account you will need to delete it. Then the forwarder will receive e-mail only.
You cannot modify an existing e-mail forwarder. You must delete the e-mail forwarder and create a new one.

Add Account Forwarder

To add a mail forwarder:

  • 1) In the Managing menu, select the domain whose e-mails you want to forward
  • 2) Click "Add" in the Create an Email Account Forwarder menu
  • 3) In the Add a New Forwarder interface, enter the username of the e-mail address you want to forward.
  • 4) In the Domain Name menu, select the domain of the e-mail address you want to forward.
  • 5) Select one of the following options in the Destination menu:
Setting Description
Forward to Email Address The system will forward incoming e-mail to another account or multiple accounts. You must enter the comma-separated destination addresses of the forwarded e-mail in the text box. For example, to forward e-mails from purchases@example.com to products@example.com and sales@example.com, enter products@example.com, sales@example.com in the text box.
Note: Forwarding e-mail accounts keep a copy of the e-mails that they forward. If you have access to both the forwarding e-mail and the destination e-mail, you can view the forwarded e-mail at both locations.
Discard and send an error to the sender (at SMTP time). The system will discard the incoming e-mail and provide the sender with a failure message. The system sets the failure message to No such person at this address by default. You may also enter a custom failure message into the Failure Message (seen by sender) text box.
  • 6) Click "Advanced Options" to access the following options:
Setting Description
Forward to a system account Select this option to forward incoming e-mail to a system user e-mail account. To do so, enter the system username in the text box.
Discard (Not Recommended) Select this option to discard e-mails without a failure message. Emails sent to the initial address will not be forwarded. Unlike the Discard and send an error to the sender (at SMTP time) option, the user will not receive any failure messages.
Pipe to a Program Select this option to pipe incoming e-mails to a program. Enter the program’s relative path in your home directory in the text box. For example, if the script requires an interpreter such as Perl or PHP, omit the /usr/bin/perl or /usr/bin/php portion of the path.
  • 7) Click "Add Forwarder"

Pipe to a Program

The pipe an email to a program can route mail to any executable within your home directory as a cPanel user, including executable scripts such as bash scripts, Perl scripts and PHP shell scripts.

  • • STDIN pipes e-mail and headers to the program.
  • • Pipes can accept variables from the $_SERVER array 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, to use the /home/user/script.pl script, enter script.pl in the Pipe to a Program text box, where user represents your username.

To pipe e-mail to a script, the script must be executable and have the appropriate hashbang) (#!). If you do not know how to add the hashbang, name the script with the correct executable extension to be prompted to automatically add it.

Domain Forwarders

Domain name forwarders redirect incoming mail for invalid addresses to another domain

The Forward All Email for a Domain table, lists all the domain name forwarders for your account.

Important: Domain forwarders only forward e-mail when the system cannot deliver it to an address or autoresponder. For example, if you create a domain name forwarder from the example.com domain to the example1.com domain and someone sends an e-mail to the user@example.com address, the following actions will occur:
If a user@example.com address or autoresponder exists, the system will not forward the e-mail.
If a user@example.com address or autoresponder does not exist, the system will forward the e-mail to user@example1.com.

Domain forwarders override the settings in cPanel’s Default Address interface
cPanel » Home » Email » Default Address

Domain forwarders only work for undeliverable e-mails. Because of this, you cannot access the e-mail at the forwarding address. For example, if an e-mail is forwarded from returns@exampl3.com to returns@example.com because exampl3.com is an invalid domain name, you cannot log in to the invalid returns@exampl3.com to view the forwarded e-mail.

Add Domain Name Forwarder

To create a domain forwarder, follow these steps:

  • 1) In the Managing menu, select the domain name whose e-mails you want to forward.
  • 2) In the Create an Email Account Forwarder menu, click Add Domain Forwarder. The Add a New Domain Email Forwarder interface will appear.
  • 3) In the domain name menu, select the domain from which you want to forward e-mail.
  • 4) In the Domain text box, enter the domain name to which you want to forward e-mail.
  • 5) Click Add Domain Forwarder.

Trace a Forwarder

Tracing an e-mail account forwarder allows you to locate a possible routing error, which may send e-mails to the wrong or non-existent location.

To trace a forwarded e-mail, perform the following steps:

1) Under the Actions menu, next to the forwarder you want to test, click Trace.

2) The Track Delivery page that appears will show you the path that the forwarded e-mail messages will take.

3) The following icons help indicate where the message is going:

  • • The red exclamation point icon () indicates that messages will encounter an error.
  • • The file page icon () indicates that the forwarder will filter messages into a file.
  • • The green globe icon () indicates that the forwarder will deliver the message to a different server.
  • • The folder icon () indicates that the message will go to a local address on this server.

4) To return to the Forwarders interface, click the Go Back button.

Delete a Forwarder

To remove a forwarder, perform the following steps:

  • 1) In the Actions menu, click Delete next to the forwarder you want to remove.
  • 2) To confirm your choice, click Delete Forwarder.

If you need to modify an e-mail forwarder, you must delete the forwarder and then create a new one.

Related cPanel Tutorials and How To Guides
Over 75 different website hosting features available

Tweet  Share  Pin  Tumble  Email

We welcome your comments, questions, corrections and additional information relating to this article. Please be aware that off-topic comments will be deleted.
If you need specific help with your account, feel free to contact us anytime
Thank you

More Articles Of Interest

RSH Web Services offers different cPanel hosting packages which are tailored to your needs. From personal, professional to business websites. We have a package that will fit your budget and needs, our reliable hosting services will work for you