I have a domain hosted by a 3rd party DNS provider. My mx records for my domain point to their mail servers and I have my email accounts handled by them. I want my Centos production tomcat server to send outgoing mail through sendmail but not receive any incoming mail.
I just changed my A record to point my domain to my production server, and changed my production server hostname to my domain name:
e.g.
hostname=www.mydomain.com
My problem now is this: My server is running sendmail, and when it sends mail to
joe@mydomain.com it is now looking for a user named joe on my server and fails if it doesn't find one. If I create a user named joe it will deliver the email into /var/spool/mail/joe.
What I want to happen is for my server's sendmail process to use the mx records located on my 3rd party DNS servers and send the mail to their mail servers so that my server does not have to handle incoming mail.
This was working fine before I changed my server's hostname to the same name as my web domain. That is to say if I send email to joe@mydomain from any other computer it is handled by my DNS server's mail server and my server was behaving that way as well before I gave it the same hostname.
Is there a way that sendmail can send the email to the mail server associated with my domain's mx records even if the email's address is the same as my server's hostname?
I am obviously new to configuring sendmail, and I fear I am missing some important point. I would appreciate any help one can give to clarify this for me.
Thanks!