Email filters use the criteria that you specify to determine how to handle email messages. The following cPanel interfaces allow you to configure email filters:
The first set of options specifies which part of the email message the system examines to determine whether the message matches your filter parameters.
You can choose from the following options:
|From||The message sender's address.|
|Subject||The message's subject line.|
The address to which the sender sent the message.
|Reply Address||The address at which the sender receives replies.|
|Body||The message's content.|
|Any Header||Any part of the message's header.|
|Any recipient||Any recipient of the message.|
|Has not been previously delivered||The system only examines messages that remain in the queue for delivery.|
|is an Error Message||The system only examines error messages that an auto-response system sends.|
|List ID||The account's mailing lists.|
|Spam Status||Whether Apache SpamAssassin™ marked the message as spam. The Spam Status line begins with
|Spam Bar||The content of the Spam Bar header that Apache SpamAssassin generated for this message. The more plus signs (
The total number of plus signs (
For more information about the Spam Score option, visit the Spam Score table.
After you select the portion of the email message that the system will examine, select the type of comparison between that portion of the email and the criteria that you enter.
You can choose from the following options:
|equals||The message exactly matches a defined string.|
The message matches a regular expression that you define.
|contains||The message a string that you define.|
|does not contain||The message does not contain the defined string.|
|begins with||The message begins with the defined string.|
|ends with||The message ends with the defined string.|
|does not begin||The message does not begin with the defined string.|
|does not end with||The message does not end with the defined string.|
|does not match||The message does not exactly match the defined string.|
The following options are only applicable when you select the Spam Score option:
|is above (#s only)||The message's Spam Score is greater than the number that you define.|
|is not above (#s only)||The message's Spam Score is equal to or less than the number that you define.|
|is below (#s only)||The message's Spam Score is less than the number that you define.|
|is not below (#s only)||The message's Spam Score is greater than or equal to the number that you define.|
Enter the criteria to use in the text box under the Rules menus. The type of data that you enter determines the comparison that the system performs.
For example, if you select the From and Equals filters, enter
firstname.lastname@example.org as the criteria. The system determines that any email from
email@example.com matches the filter, but does not match
firstname.lastname@example.org because it contains additional letters.
When cPanel determines that an email message matches your filter, it handles that message with the any of the following actions that you specify:
|Discard Message||The system discards the incoming message with no failure notice.|
|Redirect to email||The system forwards the message to another email address that you specify.|
|Fail with message||The system discards the message and automatically send a failure notice to the sender.|
|Stop Processing Rules||The system skips all filter rules.|
|Deliver to folder||The system delivers the message to a specified folder.|
|Pipe to a program||The system sends the incoming message to a specified program. For more information, read the Pipe to a Programsection below.|
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.
STDINpipes email and headers to the program.
Pipes can accept variables from the
$_SERVER array and variables on the command line.
When you use the Pipe to a Program option, enter a path that is relative to your home directory. For example, to use the
script.pl in the Pipe to a Program text box, where
user represents your username.
To ensure that the script functions properly, the script must be executable and the appropriate hashbang line must exist at the top of the script.
If you use PHP, enter the following hashbang line at the top of the script:
If you use Perl, enter 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, for example: