Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Suppose example.com has 2 MX records of identical priority:
MX 10 mx0.example.com.
MX 10 mx1.example.com.
I want to make sure my email server always connects to mx0.example.com to send emails to example.com. What are the ways I could accomplish this using sendmail?
If you always want it to use one mail server simply delete the other one from DNS.
You could make the other mail server relay all its traffic through the first one but if you're sure the first one is always going to be up it seems a little silly to do this. The only benefit I could see is the second mail server would queue up mail while the first one is down.
However, for that scenario you shouldn't give both mail servers the same priority in the first place. Set the first one to "10" and the second one to a higher number like "20". That means all traffic would go the first mail server so long as it was reachable and would only go to the second one when the first one wasn't. That is the whole point in giving them priorities in the first place.
For this fictitious scenario, example.com is another domain. My domain is mydomain.com. I am trying to send emails from my domain to example.com, making sure emails are always delivered to mx0.example.com
For this fictitious scenario, example.com is another domain. My domain is mydomain.com. I am trying to send emails from my domain to example.com, making sure emails are always delivered to mx0.example.com
You can have separate MX record setup in the two different DNS zone files - one for example.com and one for mydomain.com.
That is to say you can create example.com zone file that has ONLY the MX record for mx0.example.com.
If you then want to allow either mail server to be able to receive for mydomain.com just add both MX record to the mydomain.com zone file.
Both zone files can (and usually would) exist on the same DNS server(s). I
Are you not happy with the answers in those threads, so decide to open a new one? I responded to one, where you claimed your Sendmail would always use the lower priority MX, but we discovered your DNS was not working correctly, and you gave up.
Many mail admins configure a fake secondary MX to catch spammers. When their primary is down, you're mail server will keep retrying until the primary comes back up, or your the retry expiration time occurs.
I decided to open this thread because I thought my previous threads did not present the issue clearly. BTW, the DNS for the domain telnet-bd.com is working okay from my server, I do not know why your dig failed.
DNS servers can sometimes be offline, and this is normal. Also, DNS typically uses UDP queries, which can be dropped/lost for various reasons. What is important is not why DNS failed in the issues we discussed in the other post, but that the failure explains why your sendmail was using a secondardy MX (which you were trying to defeat, by forcing it to use the problematic primary MX).
In Postfix, one can use transport maps that can be specified to bypass the MX lookup for a given remote site; while this is not good practice as a general rule for sites that you do not own, it can be accomplished. I don't recall the mechanism in Sendmail to accomplish this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.