Default Address In Mail
This feature allows you to set up a default address that receives any mail sent to an invalid email address for the domain. The default address is also commonly called a “catch-all address.” You can also define how the default address handles incoming messages.
Set Up a Default Address
To set up your default address:
- Select the domain for which you wish to set up a default address.
Select one of the following options:
- Discard with error to sender
- Sends an error message to the sender when an email is sent to this address.
- After you select this option, enter an error message that will be emailed to the sender.
- Forward to email address
- Enter the address to which to forward emails in the text box.
- You do not need to type “@” and the domain name.
- Select Advanced Optionsfor the following options:
- Forward to your system account
- Pipe to a Program
- Automatically forwards messages to a program at the path that you define in the Pipe to a Program text box.
- For example,
- For more information about this option, see the documentation below.
- Click the Change button.
Pipe to a Program
This option routes mail to any executable script within the cPanel user's home directory. This includes executable scripts such as bash scripts, Perl scripts, and PHP scripts.
- The Pipe to a Program feature in cPanel is not typically used to filter email. Instead, it is often used to parse and enter email information into a different system.
- For example, the Pipe to a Program feature can allow you to pipe the email information to a program that enters email information into a ticket system.
- The email and headers are piped to the program via
- Memory limit issues depend on the language or environment that you use.
- Any output, even a blank line, that is created by the script, will create a bounce message that contains that output.
- Make sure that your script uses the proper file permissions (
rwxr-xr-x). To change your script's file permissions,
chmod to 755 myscript.php, where
myscript.php is meant to stand for your script's location and file name.
- Your script must contain the correct hash bang:
#!/usr/bin/php -q — For PHP.
#!/usr/bin/perl — For Perl.
- Pipes can accept variables from the
- Pipes can accept variables on the command line.