Discussion:
Relayhost to multiple hosts
(too old to reply)
Dhiraj Chatpar
2009-11-18 12:18:36 UTC
Permalink
Hi,

I am looking for a solution where i would be able to configure one postfix
instance in such a way that it rotates multiple relayhosts and acts as a
host that relays emails to multiple hosts. For eg. we currently have the
option of entering just one relayhost = xx.xx.xx.xx. However i need a
solution where i shuld be able to map multiple relayhosts and make postfix
relay via those list of hosts.

P.S. The ports also might be different in some cases.

Rgds
Dhiraj
Eero Volotinen
2009-11-18 12:27:07 UTC
Permalink
Post by Dhiraj Chatpar
Hi,
I am looking for a solution where i would be able to configure one postfix
instance in such a way that it rotates multiple relayhosts and acts as a
host that relays emails to multiple hosts. For eg. we currently have the
option of entering just one relayhost = xx.xx.xx.xx. However i need a
solution where i shuld be able to map multiple relayhosts and make postfix
relay via those list of hosts.
P.S. The ports also might be different in some cases.
You can use iptables for that or make dns round robin entry and point
relayhost to that hostname.

--
Eero
Dhiraj Chatpar
2009-11-18 13:12:25 UTC
Permalink
can you please give me a tutorial to achieve this?


Joan Crawford<http://www.brainyquote.com/quotes/authors/j/joan_crawford.html>
- "I, Joan Crawford, I believe in the dollar. Everything I earn, I
spend."
Post by Eero Volotinen
Hi,
Post by Dhiraj Chatpar
I am looking for a solution where i would be able to configure one postfix
instance in such a way that it rotates multiple relayhosts and acts as a
host that relays emails to multiple hosts. For eg. we currently have the
option of entering just one relayhost = xx.xx.xx.xx. However i need a
solution where i shuld be able to map multiple relayhosts and make postfix
relay via those list of hosts.
P.S. The ports also might be different in some cases.
You can use iptables for that or make dns round robin entry and point
relayhost to that hostname.
--
Eero
Eero Volotinen
2009-11-18 13:20:12 UTC
Permalink
Post by Dhiraj Chatpar
can you please give me a tutorial to achieve this?
See the:
http://cormander.com/blog/2008/05/round-robin-balancing-with-iptables/
and http://www.zytrax.com/books/dns/ch9/rr.html

--
Eero
Dhiraj Chatpar
2009-11-18 13:25:42 UTC
Permalink
I believe there is an option within postfix too to achieve this?


Ogden Nash <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> -
"The trouble with a kitten is that when it grows up, it's always a cat."
Post by Dhiraj Chatpar
can you please give me a tutorial to achieve this?
http://cormander.com/blog/2008/05/round-robin-balancing-with-iptables/
and http://www.zytrax.com/books/dns/ch9/rr.html
--
Eero
Eero Volotinen
2009-11-18 13:27:36 UTC
Permalink
Post by Dhiraj Chatpar
I believe there is an option within postfix too to achieve this?
As far as I known, postfix only supports one relayhost plus backup host.

--
Eero
Barney Desmond
2009-11-18 13:38:40 UTC
Permalink
Post by Dhiraj Chatpar
I believe there is an option within postfix too to achieve this?
I'm fairly sure there's not. If you don't like the idea of using
iptables, the alternative would be a customised DNS entry for your
relayhost.

Create a "virtual" relayhost A-record (eg. relayhost.mydomain.com)
that returns multiple IP addresses, this will produce a rudimentary
form of round-robin. Then just set relayhost=relayhost.mydomain.com in
main.cf
Dhiraj Chatpar
2009-11-18 13:46:32 UTC
Permalink
What do you think about this?? will this work?

http://souptonuts.sourceforge.net/postfix_sbr.html


Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html> -
"Sports is like a war without the killing."
Post by Barney Desmond
Post by Dhiraj Chatpar
I believe there is an option within postfix too to achieve this?
I'm fairly sure there's not. If you don't like the idea of using
iptables, the alternative would be a customised DNS entry for your
relayhost.
Create a "virtual" relayhost A-record (eg. relayhost.mydomain.com)
that returns multiple IP addresses, this will produce a rudimentary
form of round-robin. Then just set relayhost=relayhost.mydomain.com in
main.cf
Wietse Venema
2009-11-18 14:04:56 UTC
Permalink
Post by Dhiraj Chatpar
Hi,
I am looking for a solution where i would be able to configure one postfix
instance in such a way that it rotates multiple relayhosts and acts as a
host that relays emails to multiple hosts. For eg. we currently have the
option of entering just one relayhost = xx.xx.xx.xx. However i need a
solution where i shuld be able to map multiple relayhosts and make postfix
relay via those list of hosts.
What problem are you trying to solve? State the problem, not
the solution of multiple relayhosts and ports.

Wietse
Dhiraj Chatpar
2009-11-18 14:22:20 UTC
Permalink
We have 5 different servers.. all of them are mailing servers for our main
company domain, I wish to Balance the mails across these 5 servers.


Ogden Nash <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> -
"The trouble with a kitten is that when it grows up, it's always a cat."
Post by Dhiraj Chatpar
Post by Dhiraj Chatpar
Hi,
I am looking for a solution where i would be able to configure one
postfix
Post by Dhiraj Chatpar
instance in such a way that it rotates multiple relayhosts and acts as a
host that relays emails to multiple hosts. For eg. we currently have the
option of entering just one relayhost = xx.xx.xx.xx. However i need a
solution where i shuld be able to map multiple relayhosts and make
postfix
Post by Dhiraj Chatpar
relay via those list of hosts.
What problem are you trying to solve? State the problem, not
the solution of multiple relayhosts and ports.
Wietse
Daniel L'Hommedieu
2009-11-18 14:34:01 UTC
Permalink
We have 5 different servers.. all of them are mailing servers for our main company domain, I wish to Balance the mails across these 5 servers.
Ogden Nash - "The trouble with a kitten is that when it grows up, it's always a cat."
Post by Dhiraj Chatpar
Hi,
I am looking for a solution where i would be able to configure one postfix
instance in such a way that it rotates multiple relayhosts and acts as a
host that relays emails to multiple hosts. For eg. we currently have the
option of entering just one relayhost = xx.xx.xx.xx. However i need a
solution where i shuld be able to map multiple relayhosts and make postfix
relay via those list of hosts.
What problem are you trying to solve? State the problem, not
the solution of multiple relayhosts and ports.
Wietse
Dhiraj,

If you wish to balance the load across a number of servers, then you need a load balancer. If you can't afford one of those or do not wish to employ one of those, the poor man's way to do basic load balancing is to use round-robin DNS, as was already mentioned.

Daniel
Wietse Venema
2009-11-18 14:40:05 UTC
Permalink
Post by Dhiraj Chatpar
We have 5 different servers.. all of them are mailing servers for our main
company domain, I wish to Balance the mails across these 5 servers.
Isn't that what the DNS was invented for? You specify the domain
and its servers, and then all standards-compliant mail systems
will distribute the load according to MX preferences.

Wietse
Dhiraj Chatpar
2009-11-18 15:02:07 UTC
Permalink
Yes the DNS is a good idea..

However what will i achieve if i implement the following?


# Changes in /etc/postfix2/main.cf
sender_based_routing = yes


relay unix - - n - - smtp
-o fallback_relay=
smtp_act1 unix - - n - - smtp
-o smtp_sasl_password_maps=hash:/etc/postfix2/sasl_passwd_act1
smtp_act2 unix - - n - - smtp
-o smtp_sasl_password_maps=hash:/etc/postfix2/sasl_passwd_act2
smtp_act3 unix - - n - - smtp
-o smtp_sasl_password_maps=hash:/etc/postfix2/sasl_passwd_act3
smtp_act4 unix - - n - - smtp
-o smtp_sasl_password_maps=hash:/etc/postfix2/sasl_passwd_act4



#/etc/postfix2/sasl_passwd_act1

domainname.com



Mike Ditka <http://www.brainyquote.com/quotes/authors/m/mike_ditka.html> -
"If God had wanted man to play soccer, he wouldn't have given us arms."
Post by Wietse Venema
Post by Dhiraj Chatpar
We have 5 different servers.. all of them are mailing servers for our
main
Post by Dhiraj Chatpar
company domain, I wish to Balance the mails across these 5 servers.
Isn't that what the DNS was invented for? You specify the domain
and its servers, and then all standards-compliant mail systems
will distribute the load according to MX preferences.
Wietse
Wietse Venema
2009-11-18 15:25:28 UTC
Permalink
Post by Dhiraj Chatpar
Yes the DNS is a good idea..
However what will i achieve if i implement the following?
The solution is to have multiple MX records in the DNS.

All standards-compliant MTAs will spread the load WITHOUT
ANY SENDER SIDE CONFIGURATION.

Wietse

Loading...