RFC Local hostname in SMTP-protocol

Use this forum if you want to suggest a new feature to hMailServer. Before posting, please search the forum to confirm that it has not already been suggested.
Post Reply
berg128
Normal user
Normal user
Posts: 51
Joined: 2021-01-07 08:41

RFC Local hostname in SMTP-protocol

Post by berg128 » 2021-01-22 14:48

I succesfully setup two servers with master-slave sql db for HMS, so every change in settings on the master automatically gets replicated to the slave.

Of course I realize the settings only fully apply when the slave hmailserver is restarted, but I don't have to export and import between the two servers.

The only thing that I have to change on the slave after a restart is the local host name from mx1.mydomain.com to mx2.domain.com to get the proper hostname when sessions start using the certificate or when the reverse dns name is requested in the session.

It would be most appropriate to have a checkbox near the local hostname with which you can choose to use the Windows computername or e.g. a hostname=MX2.mydomain.com entry in hmailserver.ini
Mail Experience: Mdaemon 23 yrs Exchange 22 yrs HMS 0,16 yrs :)

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: RFC Local hostname in SMTP-protocol

Post by RvdH » 2021-01-22 15:34

You can manually set hostname under SMTP settings, that already does the trick or am i missing something?
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: RFC Local hostname in SMTP-protocol

Post by SorenR » 2021-01-22 16:01

berg128 wrote:
2021-01-22 14:48
I succesfully setup two servers with master-slave sql db for HMS, so every change in settings on the master automatically gets replicated to the slave.

Of course I realize the settings only fully apply when the slave hmailserver is restarted, but I don't have to export and import between the two servers.

The only thing that I have to change on the slave after a restart is the local host name from mx1.mydomain.com to mx2.domain.com to get the proper hostname when sessions start using the certificate or when the reverse dns name is requested in the session.

It would be most appropriate to have a checkbox near the local hostname with which you can choose to use the Windows computername or e.g. a hostname=MX2.mydomain.com entry in hmailserver.ini
Ideally: A or MX record = SMTP "Local host name" = rDNS

How about email storage? Robocopy or something else ??

Master-Slave only works one way. What if Slave receive new mail ... How will Master know?

If you use something like MySQL Mirroring you cannot change "local host name" just for one server....

Not sure "local host name" is the only show stopper.

What is your objective?

High Availability is many things ...
- Cold Standby
- Hot Standby
- Load balancing
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

berg128
Normal user
Normal user
Posts: 51
Joined: 2021-01-07 08:41

Re: RFC Local hostname in SMTP-protocol

Post by berg128 » 2021-01-22 17:03

That is correct but i now have a master-slave setup for mysql so a change on the master gets replicated but not the other way around. I would like to have a master-master setup so the changes are bidirectional. Right now MX1 is the sql-master and MX2 is the slave and it works fine as long as we restart the slave HMS after changes so it reads all data new from mysql but on the slave I now have to change the setting after I copied the entire dump.

That wouldn't be necessary if the value was fixed from .ini or read from computername.

My setup has no clients, only acts as antivirus/antispam gateway for clients where i deliver the mail on non-standard ports. So no hassle with data... :)

Also MX 10 = MX1.mydomain.com, MX 20 = MX2.mydomain.com
Reverse ip's match hostnames
hostnames match full computername where MX1/MX2 are computernames and mydomain.com are the computersuffixes.
Mail Experience: Mdaemon 23 yrs Exchange 22 yrs HMS 0,16 yrs :)

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: RFC Local hostname in SMTP-protocol

Post by SorenR » 2021-01-22 17:30

berg128 wrote:
2021-01-22 17:03
That is correct but i now have a master-slave setup for mysql so a change on the master gets replicated but not the other way around. I would like to have a master-master setup so the changes are bidirectional. Right now MX1 is the sql-master and MX2 is the slave and it works fine as long as we restart the slave HMS after changes so it reads all data new from mysql but on the slave I now have to change the setting after I copied the entire dump.

That wouldn't be necessary if the value was fixed from .ini or read from computername.

My setup has no clients, only acts as antivirus/antispam gateway for clients where i deliver the mail on non-standard ports. So no hassle with data... :)

Also MX 10 = MX1.mydomain.com, MX 20 = MX2.mydomain.com
Reverse ip's match hostnames
hostnames match full computername where MX1/MX2 are computernames and mydomain.com are the computersuffixes.
So no domains configured? ... Then why replicating the database? With no clients you have only static data and adding a new route should take no more than 30 seconds... Domain, server, port, SMTP Auth and password ... That's it.

I have two servers, primary and secondary. Primary have all the clients and the secondary is a relay set up as a Backup-MX. No domain but a route to the server handling the domain.
And ... yes I run scripts on both. I made my own RESTfull api using PHP/DCOM on IIS so if a sender is banned on one server it will tell the other - works both ways.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

berg128
Normal user
Normal user
Posts: 51
Joined: 2021-01-07 08:41

Re: RFC Local hostname in SMTP-protocol

Post by berg128 » 2021-01-22 17:44

Plenty Domains with aliases and even (dummy-)users for which pop is collected and delivered to addresses in domains.
And plenty routes to client-servers with their main emailaddresses so mail is delivered.
Also rules for some specific cases.

No mail is being kept locally.

Any change in above is replicated to the second server thus creating a solid backup secondary server.
Mail Experience: Mdaemon 23 yrs Exchange 22 yrs HMS 0,16 yrs :)

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: RFC Local hostname in SMTP-protocol

Post by SorenR » 2021-01-22 17:57

berg128 wrote:
2021-01-22 17:44
Plenty Domains with aliases and even (dummy-)users for which pop is collected and delivered to addresses in domains.
And plenty routes to client-servers with their main emailaddresses so mail is delivered.
Also rules for some specific cases.

No mail is being kept locally.

Any change in above is replicated to the second server thus creating a solid backup secondary server.
Hmm... Somewhere in my brain the is a big flashing "OVERKILL" sign but maybe it's just me that don't get your business model.

Why are you dealing with domain ALIASES ? I too have aliases for my domain and on my Backup-MX each alias have a route ...

If you are POP'ing on behalf of your clients how are you controlling servers not POP'ing at the same time?
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

berg128
Normal user
Normal user
Posts: 51
Joined: 2021-01-07 08:41

Re: RFC Local hostname in SMTP-protocol

Post by berg128 » 2021-01-22 18:07

A few advantages of this setup with onpremise servers are:
  • No exposed server/port on my clients side
  • Central management of domains/useraliases/pop collecting
  • Central management and monitoring of spam/antivirus
  • Low cost of operation
I should have written .."domains with useraliases"..

Pop and delete of course
Mail Experience: Mdaemon 23 yrs Exchange 22 yrs HMS 0,16 yrs :)

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: RFC Local hostname in SMTP-protocol

Post by SorenR » 2021-01-27 02:16

berg128 wrote:
2021-01-22 18:07
A few advantages of this setup with onpremise servers are:
  • No exposed server/port on my clients side
  • Central management of domains/useraliases/pop collecting
  • Central management and monitoring of spam/antivirus
  • Low cost of operation
I should have written .."domains with useraliases"..

Pop and delete of course
Just a heads-up I discovered - may even be re-discovered as I can't remember seing it before on my 5.6.8 release... On my Backup-MX server I have SMTP Routes to my domain and aliases. Well, that is I HAD!

If we asume my main domain is "acme.inc" I have my two servers "mx.acme.inc" and "mail.acme.inc" and I also use those FQDN's as aliases since you should per RFC be able to address user@FQDN.

So I was messing with the source code and came across a few lines involving "wildcarddomain" ... Yes, I now only have 1 (one) SMTP Route "*acme.inc" to my main server where I had 3 before.

Backup-MX now forward "*acme.inc" to my primary server which validate incoming mail against domain and names list.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

berg128
Normal user
Normal user
Posts: 51
Joined: 2021-01-07 08:41

Re: RFC Local hostname in SMTP-protocol

Post by berg128 » 2021-01-30 00:02

SorenR wrote:
2021-01-27 02:16
Just a heads-up I discovered - may even be re-discovered as I can't remember seing it before on my 5.6.8 release... On my Backup-MX server I have SMTP Routes to my domain and aliases. Well, that is I HAD!

If we asume my main domain is "acme.inc" I have my two servers "mx.acme.inc" and "mail.acme.inc" and I also use those FQDN's as aliases since you should per RFC be able to address user@FQDN.

So I was messing with the source code and came across a few lines involving "wildcarddomain" ... Yes, I now only have 1 (one) SMTP Route "*acme.inc" to my main server where I had 3 before.

Backup-MX now forward "*acme.inc" to my primary server which validate incoming mail against domain and names list.
It only shows how flexible, versatile, robust and last but not least affordable HMS is...

Did you know by the way I have read through a lot of articles in this forum for 6-8 months before I decided to give it a go? And even before that I have looked at the specs several times the past three years. I'm glad I have finally taken the step :D .

We all have different setups and reasons for using HMS and we all get it done the way we want....SPLENDID!!
Mail Experience: Mdaemon 23 yrs Exchange 22 yrs HMS 0,16 yrs :)

Post Reply