You are here:
Set Up an Email Domain Filter
An email domain filter determines whether an email relay is restricted to specific domains. You can create multiple domain filters and set their priority order using the EmailDomainFilter object in the SOAP API. An email domain filter must be set up for email relay to work.
Required Editions
| Available in: Salesforce Classic and Lightning Experience |
| Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To configure an email domain filter: | Email Administration, Customize Application, and View Setup |
If you plan to activate bounce management and email compliance management, confirm with your email admin that your company allows relaying email sent from Salesforce.
- Set up an email relayemail relay, if you haven’t already.
- From Setup, in the Quick Find box, enter Email Domain Filters, and then select Email Domain Filters.
- Select Create Email Domain Filter.
-
Configure these settings.
Setting Description Sender Domain Restricts the email relay to send emails based on the listed sender domains. Enter a comma-separated list of sender domains or patterns allowed to use the email relay. This field supports the wildcard character (*). The default is *.
example.com- DomainOnly: Sign if sending domain matches at the domain level only (example.com, but notmail.example.com).*.example.com- SubdomainsOnly: Sign if sending domain matches at the subdomain level only (mail.example.com, but notexample.com).example.com,*.example.com- DomainAndSubdomains: Sign if sending domain matches at the domain and subdomain levels (example.comandmail.example.com).
Recipient Domain Restricts the email relay to send emails based on the listed recipient domains. Enter a comma-separated list of recipient domains allowed to use the email relay. This field supports the wildcard character (*). The default is *.
If you specify certain domains, such as
*.salesforce.comand*.gmail.com, emails sent to any other domain will not be relayed. To allow emails to all recipients, use the wildcard character (*).Email Relay Specifies the relay host for the domain filter. Active Enables or disables the domain filter. The wildcard character (*) must precede a second-level domain name. For example,
*.example.comincludes all subdomains ofexample.com. - Save the page.
If you set up multiple email domain filters, only the first matching filter applies. By default, email domain filters are evaluated in the order that they were created. Use the PriorityNumber field on the EmailDomainFilter object SOAP API to change the evaluation order. If no matching rule for email relay is found, then the email sends via the Salesforce Mail servers.

