CentOS 5.8 box (Unitrends Appliance) with stock Sendmail sendmail-8.13.8-8.1.el5_7. If we email to normal addresses from the box (we have two boxes both doing the same thing) everything is fine. If we email to our domain, which has its website handled through CloudFlare's CDN, from these boxes we can't receive mail. If we look in /var/log/maillog what we see is that our address (like [email protected] is modified to [email protected].)
We receive mail from anywhere else fine. These boxes send mail anywhere else just fine. One box relays through GMail, one through Exchange 2003 - both behave the same. The issue is on the Unitrends appliance before the relay. The "cf-protected" addition only exists as a A record lookup on the CloudFlare DNS servers, so we are completely confident that somehow the server is doing a host lookup at some point in addition to the MX lookup and modifying the email address based on this lookup.
I can't find where this behavior could be originating or how to stop it.
You can turn off such rewrites in your sendmail but other sendmails would continue to rewrite.
Suggested fix: Do not use CNAME records for mydomain.com. Use them for www.mydomain.com if you have to. You may use simple www server to redirect mydomain.com visits to www.mydoain.com.