Relayhost to multiple hosts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Relayhost to multiple hosts

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.

Rgds
Dhiraj
Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Eero Volotinen-2
Quoting Dhiraj Chatpar <[hidden email]>:

> 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


Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Dhiraj Chatpar
can you please give me a tutorial to achieve this?


Joan Crawford  - "I, Joan Crawford, I believe in the dollar. Everything I earn, I spend."

On Wed, Nov 18, 2009 at 17:57, Eero Volotinen <[hidden email]> wrote:
Quoting Dhiraj Chatpar <[hidden email]>:

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



Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Eero Volotinen-2
Quoting Dhiraj Chatpar <[hidden email]>:

> 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

Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Dhiraj Chatpar
I believe there is an option within postfix too to achieve this?


Ogden Nash  - "The trouble with a kitten is that when it grows up, it's always a cat."

On Wed, Nov 18, 2009 at 18:50, Eero Volotinen <[hidden email]> wrote:
Quoting Dhiraj Chatpar <[hidden email]>:

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


Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Eero Volotinen-2
Quoting Dhiraj Chatpar <[hidden email]>:

> 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

Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Barney Desmond
In reply to this post by Dhiraj Chatpar
2009/11/19 Dhiraj Chatpar <[hidden email]>:
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Dhiraj Chatpar
What do you think about this?? will this work?

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


Ted Turner  - "Sports is like a war without the killing."

On Wed, Nov 18, 2009 at 19:08, Barney Desmond <[hidden email]> wrote:
2009/11/19 Dhiraj Chatpar <[hidden email]>:
> 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

Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Wietse Venema
In reply to this post by Dhiraj Chatpar
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
Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

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. 


Ogden Nash  - "The trouble with a kitten is that when it grows up, it's always a cat."

On Wed, Nov 18, 2009 at 19:34, Wietse Venema <[hidden email]> wrote:
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

Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Daniel L'Hommedieu
On Nov 18, 2009, at 09:22, Dhiraj Chatpar wrote:

> 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."
>
> On Wed, Nov 18, 2009 at 19:34, Wietse Venema <[hidden email]> wrote:
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Wietse Venema
In reply to this post by Dhiraj Chatpar
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
Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Dhiraj Chatpar
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  - "If God had wanted man to play soccer, he wouldn't have given us arms."

On Wed, Nov 18, 2009 at 20:10, Wietse Venema <[hidden email]> wrote:
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

Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Wietse Venema
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
Reply | Threaded
Open this post in threaded view
|

Relayhost to multiple hosts

Stan Hoeppner
Wietse Venema put forth on 11/18/2009 9:25 AM:

> 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

That master.cf with all the sasl makes me think he's wanting to spread
spam load out over 5 broadband smtp submission servers over 5 dsl lines
or similar.  His resistance to using DNS, which is the proper (and easy)
solution for a legit operation, and the fact that he's spreading the
load of only one server across 5 also smells of a spammer.

Are we assisting a spammer or a legit operation?  Dhiraj?  What's the
skinny?

--
Stan

Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Dhiraj Chatpar
Well sir its our friend yahoo which is going to get me kicked off my job as an administrator. I had an issue where a email sent to a yahoo email address from My CEO didnt end up delivering. Ever since i have been wondering for solutions. And this is something i could think of. Since when did spammers start posting on legit forums?


Mike Ditka  - "If God had wanted man to play soccer, he wouldn't have given us arms."

On Wed, Nov 18, 2009 at 23:14, Stan Hoeppner <[hidden email]> wrote:
Wietse Venema put forth on 11/18/2009 9:25 AM:
> 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

That master.cf with all the sasl makes me think he's wanting to spread
spam load out over 5 broadband smtp submission servers over 5 dsl lines
or similar.  His resistance to using DNS, which is the proper (and easy)
solution for a legit operation, and the fact that he's spreading the
load of only one server across 5 also smells of a spammer.

Are we assisting a spammer or a legit operation?  Dhiraj?  What's the
skinny?

--
Stan


Reply | Threaded
Open this post in threaded view
|

Re: Relayhost to multiple hosts

Noel Jones-2
On 11/18/2009 11:47 AM, Dhiraj Chatpar wrote:
> Well sir its our friend yahoo which is going to get me kicked off my job
> as an administrator. I had an issue where a email sent to a yahoo email
> address from My CEO didnt end up delivering. Ever since i have been
> wondering for solutions.

You're trying to solve a problem that you can't solve.  If 99%
of your mail addressed to yahoo eventually gets delivered,
you've done as well as can be expected and better than most.

Your real job is to explain this in terms the CEO can
understand.