Page tree
Skip to end of metadata
Go to start of metadata

This document is for a previous release of cPanel & WHM. To view our latest documentation, visit our Home page.

For cPanel & WHM 11.46

(Home >> Mail >> Default Address)


Overview

This interface allows you to set up a default address that receives any mail that was sent to an invalid email address for the domain. The default address is also known as a “catch-all address.” You can also define how the default address handles incoming messages.

Note

If spammers target your domain, and you forward mail to a default address, that address is likely to receive a large amount of spam.

Set Default Address

To set a default address for your domain, perform the following steps:

  1. Select the domain for which you wish to set a default address.
  2. Select one of the following options:

    • Discard the email while your server processes it by SMTP time with an error message — Select this option to send an error message to the sender when an email is sent to this address. Enter an error message in the text box.
    • 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.

      Note:

      $body

    • Click Advanced Options to view the following additional options:
      • Forward to your system account — Select this option to forward mail to the system account.
      • Pipe to a program — Select this option to forward messages to a program at the path that you define in the Pipe to a Program text box.

        Note:

        For more information, read the Pipe to a Program section of our How to Configure Mail Filters documentation.

      • Discard — Select this option to delete incoming messages without a failure notice.

        Important:

        We do not recommend this option, because the sender will not know that the delivery failed. 

  3. Click Change.

Pipe to a Program

Important:

Make certain 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 represents your script's location and file name.

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.

  • STDIN pipes email 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.

Note:

If you use PHP, make certain that you appropriately wrap your code in start and end tags.