Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

Sendmail - problem sending to own domain when web host is not the mail host

I  recently set up a web server using mydomain.com.   I have a properly configured mail server for this domain that is hosted by a third party.

After installing sendmail, I can send messages to any domain but my own.  The message I'm getting in the mail log is "user unknown" because sendmail is treating mail sent to mydomain.com as local mail. How do I get sendmail to treat messages sent from the web server to mydomain.com like any other message?
  • 2
1 Solution
1. Edit the /etc/mail/local-host-names file and remove "mydomain.com"
2. Edit /etc/hosts and remove "mydomain.com". You should have a host entry for the actual computer (server1.mydomain.com), but not just the domain name.
thomas_ncAuthor Commented:
I updated the /etc/mail/.local-host-names file and that did the trick for sending the mail out, but now the mx servers are reporting that user@mydomain.com does not exist when looking at the Return-Path.

This is correct because the Return-Path root@mydomain.com is not a valid account.  How can I get the "Return-Path" set to something that my mail server will not try to validate on it's end as a local account?  Or, could there be something else going on?

I suppose the Return-Path would need to be root@server1.mydomain.com, but am not sure.  Here is the host info for the server, if that helps:

I have an entry in /etc/hosts:
server1.mydomain.com  xx.xx.xx.xx (the public IP addr)

..and in /etc/sysconfig:

Your return-path really just needs to be any email address with a valid domain. It's not going to check the user part, to see if there is an account created for that user, but it'll try to resolve the domain. Where are you seeing this "does not exist" error? Are you using the domain is right (not misspelled)? Does it have an MX record and associated A record in DNS?

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now