Changes between Version 6 and Version 7 of Saleforce Improper Email setup(s)


Ignore:
Timestamp:
12/15/22 16:31:17 (2 years ago)
Author:
Paul Kulda
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Saleforce Improper Email setup(s)

    v6 v7  
    55
    66
    7 [[https://help.salesforce.com/s/articleView?id=000316016&type=1]]
     7Email Relay best practices
     8Publish Date: May 13, 2022
     9Description
     10Below are some best practices that need to be considered when setting up email relay for your organization.
     11
     12For additional information, please review the Considerations for Setting up Email Relay documentation.
     13 
     14Resolution
     15
     16Note: Information in this article applies to both Classic and Lightning Experience
    817
    918
    10 {{{
    11 #!html
    12 <iframe src="https://help.salesforce.com/s/articleView?id=000316016&type=1" width="400" height="400"></iframe>
    13 }}}
     19What is Email Relay
     20
     21Email relay automatically routes Salesforce-generated emails through your company’s mail service. For more information on email relay, please review Set Up Email Relay.
     22
     23
     24Deliverability settings and mail relay
     25
     26Once email relay is enabled in Salesforce, companies do not necessarily need to use all of Salesforce’s Email Deliverability settings located under: Setup | Email Administration | Deliverability. This is because some of these settings (listed below) modify the envelope-from address of emails sent from Salesforce. The header From address remains set to the sender's email address. The return-path in the headers is also modified. This change in the email headers may affect email delivery to your email server, as the modified return-path will include a Variable Envelope Return Path value (VERP). 
     27 
     28Example standard return-path: <name@domain.com>
     29Example of Variable Envelope Return Path (VERP): <name=domain.com__x@x.bnc.salesforce.com>
     30
     31Therefore, we recommend companies to disable the following two email deliverability options when using email relay. You can read more about these settings in Guidelines for Configuring Deliverability Settings for Emails from Salesforce.
     32 
     33In Salesforce Classic: Navigate to Setup | Email Administration | Deliverability
     34In Lightning Experience: Navigate to Gear icon | Setup | Email | Deliverability 
     35 
     36a) Turn OFF Activate Bounce Management.
     37b) Turn OFF Enable compliance with standard email security mechanism and
     38Enable Sender ID compliance
     39  After disabling these settings, outbound email sent from Salesforce to your relay server will show both envelope-from and return-path as <name@domain.com>.
     40
     41For background information on IPs used for Email Relay see: Ensure you can receive email from the Salesforce application
     42
     43
     44Securing your Email Relay
     45
     46Here are some suggestions for ensuring that your mail relay is secure and that you relay only mail that you intend to:
     47
     48    Have your relay allowlist only the IPs you want to relay mail for (ours and any others)
     49    Only relay mail that is sent using your mail domain
     50    Enforce TLS (optionally set it to TLS required or required and verify the hostname on the certificate)
     51    Have your relay verify the hostname on our certificate
     52    Look for a header - X-SFDC-LK and ensure that it has your orgid in it. Only relay mail from salesforce if it has the proper orgid
     53    Use DKIM signing in salesforce and only relay mail if the DKIM signature passes
     54
     55
     56
     57Bounce Management with Email Relay
     58
     59Using Email Relay and Bounce Management together requires special care because it can cause Sender Policy Framework (SPF, a common email security standard) to fail to validate. The Salesforce bounce management feature relies on setting each outgoing email's return path (also called the "envelope from address") to an address at bnc.salesforce.com. SPF works by extracting the domain in the return path to find a set of authorized IP addresses. When you use Email Relay and Bounce Management, the IP address of your relay will not match the authorized IP addresses for the domain (bnc.salesforce.com). This will result in an SPF "soft failure" -- it does not mark your message as invalid, but it may reduce your deliverability.
     60
     61One solution is to establish a DMARC policy for your domain, and then use Salesforce's DKIM signing feature to sign outgoing mail. With this combination, your mail will pass a DMARC check, even though it does not pass SPF.
     62
     63Another solution is to turn off bounce management in Salesforce.
     64
     65
     66
     67Email Relay with Office 365
     68For more details about relaying with Office 365 see Salesforce 'Email Relay' with Office 365
     69
     70Email Relay with Gmail
     71For more details about relaying with Gmail see Salesforce 'Email Relay' with Gmail
     72Knowledge Article Number
     73
     74000382778
     75
     76Considerations for Setting Up Email Relay
     77
     78Before setting up Email Relay, review details about bounce management and spam.
     79Available in: Salesforce Classic and Lightning Experience
     80Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions
     81
     82    Email Relay is a good option if:
     83        You want to route email sent from Salesforce through your company’s mail service, such as for compliance.
     84        Your company owns its domain (mycompany.com).
     85    Salesforce send limits still apply to email relaying.
     86    Email Relay requires some technical expertise to set up.
     87
     88Bounce Management with Email Relay
     89
     90To use Bounce Management, your email server must allow the relaying of email sent from Salesforce with a salesforce.com domain.
     91
     92Use Email Relay and Bounce Management with care as it can cause Sender Policy Framework (SPF), a common email security standard, to fail to validate. The Salesforce bounce management feature relies on setting each outgoing email's return path, the envelope from address, to an address at bnc.salesforce.com. SPF works by extracting the domain in the return path to find a set of authorized IP addresses.
     93
     94When you use Email Relay and Bounce Management, the IP address of your relay doesn’t match the authorized IP addresses for the domain (bnc.salesforce.com). This mismatch results in a SPF soft failure. It doesn’t mark your message as invalid, but it reduces your deliverability.
     95
     96There are two solutions:
     97
     98    Establish a DMARC policy for your domain, and use Salesforce's DKIM signing feature to sign outgoing mail. With this combination, your mail passes a DMARC check even though it doesn’t pass SPF.
     99    Turn off bounce management in Salesforce.
     100
     101Deliverability Settings and Email Relay
     102
     103When email relay is enabled in Salesforce, companies don’t always need all the Salesforce Email Deliverability settings from Setup. Some of these settings modify the envelope-from address of emails sent from Salesforce. The header From address remains set to the sender's email address. The return-path in the headers is also modified. This change in the email headers may affect email delivery to your email server because the modified return-path includes a Variable Envelope Return Path value (VERP).
     104
     105    Example of a standard return-path: <name@domain.com>
     106    Example of a VERP return-path: <name@domain.com__x@x.bnc.salesforce.com>
     107
     108Disable these email deliverability options when using email relay.
     109
     110    Turn off Enable compliance with standard email security mechanisms.
     111    Consider turning off Activate Bounce Management.
     112
     113After disabling the settings, outbound email sent from Salesforce to your relay server shows the envelope-from and the return-path as <name@domain.com>.
     114Securing Your Email Relay
     115
     116Follow these suggestions to ensure that your mail relay is secure and that you relay only the mail that you intend to.
     117
     118    Include only the IPs that you want to use to relay mail for ours and any others in your relay’s allowlist.
     119    Only relay mail that’s sent using your mail domain.
     120    Enforce TLS. Optionally set it to TLS required or required and verify the hostname on the certificate.
     121    Have your relay verify the hostname on our certificate.
     122    Look for a header - X-SFDC-LK and ensure that it has your orgid in it. Only relay mail from Salesforce if it has the proper orgid.
     123    Use DKIM signing in Salesforce and only relay mail if the DKIM signature passes.
     124    Enable SMTP authentication between Salesforce mail servers and your email relay host. Test this feature in a sandbox to ensure that it works as expected. Some email services don’t support SMTP authentication for email relays.
     125
     126Copying Sandbox with Email Relay
     127
     128When you copy a sandbox, Email Relay data is copied to the sandbox org. This data includes authentication data stored on an Email Relay record, such as IsRequireAuth, Password, and Username. If you don’t want production authentication data in your sandbox copy, modify the Email Relay in Setup.
     129
     130Alternatively, you can execute this sample Apex code in your Sandbox Developer Console to remove authentication data from the EmailRelay records.
     131
     132System.debug('Executing sandbox postcopy update for EmailRelay');
     133
     134// Query all EmailRelay objects with non-empty credentials and reset.
     135
     136List<EmailRelay> relays = [SELECT Id FROM EmailRelay WHERE IsRequireAuth = true OR Username != null];
     137
     138for (EmailRelay relay : relays) {
     139
     140relay.IsRequireAuth = false;
     141
     142relay.Username = null;
     143
     144relay.Password = null;
     145
     146}
     147
     148update relays;
     149
     150System.debug('Updated ' + relays.size() + ' EmailRelay objects');
     151See Also