LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Forcing to use a particular MX (http://www.linuxquestions.org/questions/linux-server-73/forcing-to-use-a-particular-mx-669174/)

the_gripmaster 09-11-2008 06:14 AM

Forcing to use a particular MX
 
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?

Thanks.

MensaWater 09-11-2008 08:25 AM

I don't understand what you're trying to do here.

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.

the_gripmaster 09-14-2008 06:44 AM

@jlightner
 
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

MensaWater 09-14-2008 08:00 AM

Quote:

Originally Posted by the_gripmaster (Post 3279940)
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

Mr. C. 09-14-2008 03:35 PM

I recall you asking this question previously. And a search reveals this is your third thread asking essentially the same question. The other two are:

http://www.linuxquestions.org/questi...ity-mx-668284/
http://www.linuxquestions.org/questi...lar-mx-665679/

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.

What REAL problem are you trying to solve?

the_gripmaster 09-15-2008 01:17 AM

@Mr. C.

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.

Mr. C. 09-15-2008 10:57 AM

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.


All times are GMT -5. The time now is 07:09 AM.