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

I want to load balance outbound emails between 3 post-fix gateways for sending mails only reason is to use multiple different source IPs to increase throughput & inbox delivery. Each gateway should receive an approximately equal amount of outbound messages.

How is it possible please suggest.

                    +----------> smtp A ---------> Internet
                    |                                  
clients --------> smtp lb -----> smtp B ---------> Internet
                    |                                  
                    +----------> smtp C ---------> Internet
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

One wonders what it is you are doing.

Nonetheless, the typical way to do this is by using round robin DNS for your SMTP server (define multiple A records for some DNS name, and specify that as the outbound SMTP server on whatever is originating emails, like an email client).

You could also make a load balancer out of another postfix server, because SMTP servers normally send emails to each other for forwarding. You should be able to do this simply by setting up multiple forwarders for it. If your emails are coming from a single source which caches DNS replies, this would be the more likely solution.

The way you do this is a bit of a hack: you set up a local DNS name which you configure as the relayhost in main.cf. Then, for that DNS name, configure multiple MX records with the same priority:

smtp-out IN MX 10 smtp-a.example.com.
smtp-out IN MX 10 smtp-b.example.com.
smtp-a.example.com. IN A 0.0.0.0
smtp-b.example.com. IN A 0.0.0.0
share|improve this answer
    
Hi, Falcon I am the newbiee can you suggest how to use round robin dns for smtp. I have already multiple A records for the server as mail1.example.com, mail2.example.com, mail3.example.com –  user103373 Oct 19 '12 at 5:27
    
You use RR DNS by putting multiple A records for the same DNS name. You can set up another name and specify "somename IN A x.x.x.x" multiple times, changing x.x.x.x to each different IP. –  Falcon Momot Oct 19 '12 at 5:29
    
this solution works for me thanks @falcon –  user103373 Oct 20 '12 at 6:47
add comment

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.