Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

when i query for the mailservers of domainx with "dig domainx.com MX" the result is:

...
;; ANSWER SECTION:
domainx.com. 55188 IN MX 120 mail2.domainx.com.
domainx.com. 55188 IN MX 100 mail.domainx.com.
...

When the webserver (postfix) sends a mail to someone@domainx.com it uses mail.domainx.com as relay.

Now, i want to test if he really switches to mail2.domainx.com if mail.domainx.com is not available. I have no access to the mailservers, just the webserver which is running postfix.

I thought of temporarily making a false entry in /etc/hosts for mail.domainx.com on the webserver - will this work?

Is there another and better way?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You could temporarily add a blackhole route to the primary MX and then observe Postfix's behaviour.

Linux

ip route add blackhole ip.add.re.ss

Solaris/BSD

route add -host ip.add.re.ss 127.0.0.1 -blackhole
share|improve this answer
    
THX - This is a nice solution. Sadly my webserver says "command not found" for route or ip. i think i have to go with the /etc/hosts - version. –  Benjamin Dec 15 '11 at 16:03

Usualy, I test this problematic with the firewall : I put a filter from my server to the IP of mail.domainx.com, on the SMTP port (25/tcp).

Then, Postfix can't join the first server and should try the second.

But I think you can do the same thing with your /etc/hosts proposition, by choosing an IP which doesn't exists.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.