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.

I'm trying to configure my mail server to deliver mail to relay servers in round-robin fashion using Linux and sendmail 8.13.8.

I want to achieve the following:

Let's say I run mail.example.com as the mail server, and have relay1, relay2, relay3, and relay4 ready for actual mail delivery.

Five emails arrive to mail.example.com:

mail 1 => relay1.example.com mail 2 => relay2.example.com mail 3 => relay3.example.com mail 4 => relay4.example.com mail 5 => relay1.example.com

And so forth.

I tried to set this up by defining multiple smart hosts, but it seems like the supplementary hosts only activate if the hosts before them fail.

Clearly that isn't the way. How should this be done correctly?

share|improve this question
1  
Are you asking about email that arrives at your domain (and hence you want to load balance email reception) or are you asking about email that you send and you want to load balance it to five outgoing relays? –  adamo Sep 14 '12 at 7:56
    
I want to balance to four outgoing relays. –  Aleksi Asikainen Sep 14 '12 at 14:02

1 Answer 1

In your sendmail.mc:

define(SMART_HOST, relay1:relay2:relay3:relay4)dnl

Then according to your distribution's instructions create sendmail.cf and restart sendmail. In Debian you just type sendmailconfig. In CentOS you type /etc/mail/make followed by a service sendmail restart.

If the relays have MX records, you may need to enclose them in square brackets

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.