Exchange is modifying emails before forwarding them out to an external Google Apps account. I'm hoping to find a way to fix this.
Here's some more detail:
Using Exchange 2010 SP3 Version 126.96.36.199
The exchange server is forwarding email of some users out to Google Apps accounts (using an External Contact in AD). Exchange is set to put the emails in the user's mailbox and also forward a copy to their Google Apps account. The issue is that outside emails (from @google.com for example) are failing the DKIM check on the Google Apps side after being forwarded from Exchange and they are marked as spam. I got this info from looking at the email source and seeing this message:
Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) email@example.com; spf=pass (google.com: domain of firstname.lastname@example.org designates 188.8.131.52 as permitted sender) email@example.com; dmarc=fail (p=REJECT dis=NONE) header.from=example.com
- firstname.lastname@example.org - a user with an exchange mailbox and Google apps
- 184.108.40.206 - outside IP of Exchange server, included in SPF record
- example.com - outside public domain that has dmarc configured
Testing and results of direct vs forwarded emails:
Below is a sample of two emails. One email was sent to the Exchange server user's email address, the other email was sent directly to the Google Apps email address using the temporary Google Apps assigned domain alias (email@example.com).
The subject and body were exactly the same in both emails sent out. The only difference between the two received is that the Exchange forwarded email had modified the body boundaries and the charset value now has quotes around the UTF-8.
Direct to Gmail (firstname.lastname@example.org):
Content-Type: multipart/alternative; boundary=001a1149a47ee5ea57053414b981 --001a1149a47ee5ea57053414b981 Content-Type: text/plain; charset=UTF-8 Test body --001a1149a47ee5ea57053414b981 Content-Type: text/html; charset=UTF-8 <div dir="ltr">Test body </div> --001a1149a47ee5ea57053414b981--
Forwarded from Exchange (email@example.com):
Content-Type: multipart/alternative; boundary="001a1149a47ee5ea57053414b981" --001a1149a47ee5ea57053414b981 Content-Type: text/plain; charset="UTF-8" Test body --001a1149a47ee5ea57053414b981 Content-Type: text/html; charset="UTF-8" <div dir="ltr">Test body </div> --001a1149a47ee5ea57053414b981--
I have a feeling that the DKIM fails because Exchange has added the quotes to the charset and boundary parameter values. Hopefully there is a way to disable this and then emails will pass the dkim without issue.