Multiple SMTP Gateway Out on hMailServer

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Locked
itmnetworks
New user
New user
Posts: 2
Joined: 2010-07-27 07:36
Location: Brazil
Contact:

Multiple SMTP Gateway Out on hMailServer

Post by itmnetworks » 2010-07-27 09:24

Hello,

Is possible use Multiple SMTP Gateway Out on hMailServer ?

If is possible, how can setup this ?

Per example:

We have:
1 x hMailServer primary email server with pop3, imap and smtp IN / OUT
3 x SMTP Gateways Out (3 diferent servers)

I need setup on hMail Server primary email server to send emails using my 3 smtp gateway out using round robin (balanced), is possible ? how can setup this ?

best regards,

Rodrigo Araujo
ITMNETWORKS

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Multiple SMTP Gateway Out on hMailServer

Post by ^DooM^ » 2010-07-27 11:04

This is not possible with hmail unless you have something sat between hmail and your 3 gateways that load balances.

You could perhaps cheat using routes and rules to offload large domain emails to people like hotmail/yahoo/gmail etc to specific smtp gateways but that would be about the best you can do, assuming I have understood your question correctly.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

prisma
Senior user
Senior user
Posts: 309
Joined: 2010-07-09 13:16

Re: Multiple SMTP Gateway Out on hMailServer

Post by prisma » 2010-07-27 11:54

Possibly a stupid idea, haven't tried it. But could work:
* If you have a local DNS in your network, you could activate round-robin there.
* Make 3 A-records for 1 smtp-hostname with 3 different IP adresses.
* Set lifetime of these records to X seconds (e.g. 1). But don't let the record be deleted, if record expired !!

So, hmailserver should try to resolve every X seconds the smtp-hostname new. And every time he should get a different IP.
(resolving a new IP address could cost time, but if the DNS-Server is e.g. on localhost, and dedicated only for his own DNS resolution, this should be no problem.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Multiple SMTP Gateway Out on hMailServer

Post by ^DooM^ » 2010-07-27 12:14

That could work assuming hmail does not cache dns lookup.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

Bill48105
Developer
Developer
Posts: 6189
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Multiple SMTP Gateway Out on hMailServer

Post by Bill48105 » 2010-07-27 15:55

Kinda what MX records do but more fail over in order vs real round robin.. If these are not your domains you're likely breaking some RFC not delivering per the MX setting actually..

Should be able to do something with scripting, just change the Route value in the database but realize caching can come into play with that too along with timing.

Could be handy if more than one IP was possible in Route setup for something like this.. With either fail over or round robin option. Feature request! :D
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

itmnetworks
New user
New user
Posts: 2
Joined: 2010-07-27 07:36
Location: Brazil
Contact:

Re: Multiple SMTP Gateway Out on hMailServer

Post by itmnetworks » 2010-07-27 16:04

prisma wrote:Possibly a stupid idea, haven't tried it. But could work:
* If you have a local DNS in your network, you could activate round-robin there.
* Make 3 A-records for 1 smtp-hostname with 3 different IP adresses.
* Set lifetime of these records to X seconds (e.g. 1). But don't let the record be deleted, if record expired !!

So, hmailserver should try to resolve every X seconds the smtp-hostname new. And every time he should get a different IP.
(resolving a new IP address could cost time, but if the DNS-Server is e.g. on localhost, and dedicated only for his own DNS resolution, this should be no problem.
Hello,

Very thanks, no is stupid idea :-) is a good idea.

I have realy 254 SMTP Gateway OUT, i will go to install a local DNS Server on primary hmailserver and set dns record TTL with 2 Secs.

Best Regards,
Rodrigo Araujo
www.itmnetworks.com.br

prisma
Senior user
Senior user
Posts: 309
Joined: 2010-07-09 13:16

Re: Multiple SMTP Gateway Out on hMailServer

Post by prisma » 2010-07-27 16:13

If these are not your domains you're likely breaking some RFC not delivering per the MX
??? hum, what? MX? If you are delivering via route or general relayer (and so I understood the meaning of 3 smpt-Gateways) you name a explicit smtp-Server. This has nothing to do with MX name resolution. Maybe I understood wrong... but I don't think so.

Idea of scripting is not bad. But you have to be able to do it. Somebody, who is able to set up a mailserver, should have set up a localhost DNS-Server in 5 minutes.

Bill48105
Developer
Developer
Posts: 6189
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Multiple SMTP Gateway Out on hMailServer

Post by Bill48105 » 2010-07-27 16:25

prisma wrote:
If these are not your domains you're likely breaking some RFC not delivering per the MX
??? hum, what? MX? If you are delivering via route or general relayer (and so I understood the meaning of 3 smpt-Gateways) you name a explicit smtp-Server. This has nothing to do with MX name resolution. Maybe I understood wrong... but I don't think so.

Idea of scripting is not bad. But you have to be able to do it. Somebody, who is able to set up a mailserver, should have set up a localhost DNS-Server in 5 minutes.
I did state *if* they are domains that are not his.. Which means he's sending to other people which means he should be using MX lookups to deliver to them & honor those records, not choosing his own order, servers, or trying to force relay thru 3rd party on his whim. If he's doing it any other way pretty sure he's not abiding by RFC & why MX records have pref to state order. Sure people don't follow rules (like spammers), there are valid exceptions (like using an ISP as smarthost but THEY should use MX as mentioned) and obviously if they are his domains then he won't be mad at himself. ;)

I don't recall saying "DON'T do the DNS thing prisma suggested, it's a stupid idea!" My comment had nothing to do with yours whatsoever. It was just a response to HIM & his original post, not you.
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

prisma
Senior user
Senior user
Posts: 309
Joined: 2010-07-09 13:16

Re: Multiple SMTP Gateway Out on hMailServer

Post by prisma » 2010-07-27 16:38

stay cool man. I know that you've not been posting to me. But what you posted seemed to do not fit the problem. As far as I understood the problem. But I said: Maybe I understood the hole scenario wrong... I only wanted to help. And I did help.

Bill48105
Developer
Developer
Posts: 6189
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Multiple SMTP Gateway Out on hMailServer

Post by Bill48105 » 2010-07-27 16:52

prisma wrote:stay cool man. I know that you've not been posting to me. But what you posted seemed to do not fit the problem. As far as I understood the problem. But I said: Maybe I understood the hole scenario wrong... I only wanted to help. And I did help.
I am calm, cool & collected. Cool as a cucumber. I better get outta this freezer before I get frostbite. lol

Your response was to me & you quoted me & your content was regarding MX which only I said something about so..

Perhaps the MX stuff doesn't apply if he's really sending thru gateway/smarthost instead of normal delivery, got me. Really bad idea to assume anything based on 1 post. Think you read too much into the MX part of my comment which was an aside really. ;)

Based on his response it seems you did help which makes your off-the-cuff response to me seem pointless.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Multiple SMTP Gateway Out on hMailServer

Post by ^DooM^ » 2010-07-27 17:38

:roll:
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

Locked