Multiplatform (Linux)

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
DigDug
New user
New user
Posts: 21
Joined: 2020-12-04 19:46

Multiplatform (Linux)

Post by DigDug » 2020-12-04 19:54

I donated a small amount since I use hMailServer for my mail server on my Windows VPS.

I'm, however, planning to move my stuff to my Raspberry Pi 400 server, but I found out that hMailServer is only available for Windows.

Why not use a cross-platform HTML interface (only on localhost or internal network IP's)? The WinForms interface can then be retired.

Also, I was surprised to find that hMailServer is written in C++. Looking at the UI I believed it to have been written in C#. I'm a C++ and C# developer by trade, but feel more comfortable with a mail server written in C# because of the automatic memory management.

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

Re: Multiplatform (Linux)

Post by SorenR » 2020-12-04 23:59

DigDug wrote:
2020-12-04 19:54
I donated a small amount since I use hMailServer for my mail server on my Windows VPS.

I'm, however, planning to move my stuff to my Raspberry Pi 400 server, but I found out that hMailServer is only available for Windows.

Why not use a cross-platform HTML interface (only on localhost or internal network IP's)? The WinForms interface can then be retired.

Also, I was surprised to find that hMailServer is written in C++. Looking at the UI I believed it to have been written in C#. I'm a C++ and C# developer by trade, but feel more comfortable with a mail server written in C# because of the automatic memory management.
So... Do you also give your mom a big bag of laundry to do because you are more comfortable with her color separation skills ??

An old buddy of mine had a habit of writing Windows applications in Assembler because he was more comfortable with Assembler. He later switched to high level compilers and his programs has now exploded in size with all the bloatware compilers carry.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
mattg
Moderator
Moderator
Posts: 22435
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Multiplatform (Linux)

Post by mattg » 2020-12-05 00:56

DigDug wrote:
2020-12-04 19:54
. I'm a C++ and C# developer by trade
https://www.hmailserver.com/forum/viewt ... =13&t=3491
Martin wrote:It would probably take a few weeks of full-time work to port it to Linux. hMailServer uses a lot of Windows functionality that works very differently under Linux. For example, socket implementation, thead synchronization and other things
.

Source is here
https://github.com/hmailserver/hmailserver

I'd love to see a Linux port too. I'm not a professional developer, but I'm happy to help.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

DigDug
New user
New user
Posts: 21
Joined: 2020-12-04 19:46

Re: Multiplatform (Linux)

Post by DigDug » 2020-12-05 16:15

There are several options:

You could port the code to wxWidgets, which has socket and thread primitives and gives you multiplatform functionality out of the box (including the UI). I'm an experience wxWidgets C++ developer, so as far as the UI is concerned I could lend a hand.

The other option would be to port the C++ code using conditional compilation and adding Unix counterparts / equivalents for socket and thread primitives.

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

Re: Multiplatform (Linux)

Post by SorenR » 2020-12-05 18:47

DigDug wrote:
2020-12-05 16:15
There are several options:

You could port the code to wxWidgets, which has socket and thread primitives and gives you multiplatform functionality out of the box (including the UI). I'm an experience wxWidgets C++ developer, so as far as the UI is concerned I could lend a hand.

The other option would be to port the C++ code using conditional compilation and adding Unix counterparts / equivalents for socket and thread primitives.
I presume the very first thing is to agree on a new API to hold everything together since at present everything evolves around the API.

Also a way to host the system on multiple servers in a high availability environment either as a hot-backup or as a distributed architecture.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
mattg
Moderator
Moderator
Posts: 22435
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Multiplatform (Linux)

Post by mattg » 2020-12-06 01:57

The existing GUI uses exclusively the COM API, so in my mind matching the existing API would be good
That way things like the web based GUIs that already exist could use the linux server backend without too much adjsutment

this should also then allow us to use our existing scrips, and addon's that we have coded / created over the years
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

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

Re: Multiplatform (Linux)

Post by SorenR » 2020-12-06 02:39

mattg wrote:
2020-12-06 01:57
The existing GUI uses exclusively the COM API, so in my mind matching the existing API would be good
That way things like the web based GUIs that already exist could use the linux server backend without too much adjsutment

this should also then allow us to use our existing scrips, and addon's that we have coded / created over the years
Well, imagine a middleware (MOM or ORB) connecting database, file storage, service application and GUI. That way you could have one server hosting database and file storage, another pair of servers hosting service application and then the GUI on whatever OS you prefer.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
mattg
Moderator
Moderator
Posts: 22435
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Multiplatform (Linux)

Post by mattg » 2020-12-06 03:05

SorenR wrote:
2020-12-06 02:39
mattg wrote:
2020-12-06 01:57
The existing GUI uses exclusively the COM API, so in my mind matching the existing API would be good
That way things like the web based GUIs that already exist could use the linux server backend without too much adjsutment

this should also then allow us to use our existing scrips, and addon's that we have coded / created over the years
Well, imagine a middleware (MOM or ORB) connecting database, file storage, service application and GUI. That way you could have one server hosting database and file storage, another pair of servers hosting service application and then the GUI on whatever OS you prefer.
We can almost do that now, except the server(s) hosting the service application must be on a Windows platform (it does run on the free HyperV-Server operating systems - I have tested that), so If we could get that bit to run natively on Linux, I'd be interested
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

DigDug
New user
New user
Posts: 21
Joined: 2020-12-04 19:46

Re: Multiplatform (Linux)

Post by DigDug » 2020-12-06 09:35

The COM API is used for automation, I presume?

That's something that wxWidgets does not support, or only in a limited fashion since it's inherently tied to Windows.

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

Re: Multiplatform (Linux)

Post by SorenR » 2020-12-06 13:51

DigDug wrote:
2020-12-06 09:35
The COM API is used for automation, I presume?

That's something that wxWidgets does not support, or only in a limited fashion since it's inherently tied to Windows.
Without the COM API you cannot control, diagnose or configure hMailServer. The GUI do not access the database.
Information is cached by hMailServer thus any configuration changes done in the database will not come into effect until you restart the server.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

DigDug
New user
New user
Posts: 21
Joined: 2020-12-04 19:46

Re: Multiplatform (Linux)

Post by DigDug » 2020-12-08 18:44

Why would you need a COM API for this?

You could configure the server with either configuration files or a HTML user interface like everyone else.

Biggest drawback is that COM ties it exclusively to Windows.

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

Re: Multiplatform (Linux)

Post by SorenR » 2020-12-08 20:28

DigDug wrote:
2020-12-08 18:44
Why would you need a COM API for this?

You could configure the server with either configuration files or a HTML user interface like everyone else.

Biggest drawback is that COM ties it exclusively to Windows.
Well, then hMailServer will be like any other server so go have a look at Sendmail/Dovecut.

The idea of the API is that the hMailServer core directly manages database and cached information and that the GUI "talk" only to the hMailServer core.
No need to reload configuration files and no need to reload cached information if the hMailServer core can update them live.

It's how real programmers program carrier grade applications.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

DigDug
New user
New user
Posts: 21
Joined: 2020-12-04 19:46

Re: Multiplatform (Linux)

Post by DigDug » 2020-12-09 17:13

So that's simply a three-layer application with GUI, Business Layer ("Core") and Database layer.

Nothing really special about that, I would say. Most programs I develop uses this architecture. Mine are even more advanced since I unit-test the GUI with Model-View-Presenter.

palinka
Senior user
Senior user
Posts: 4455
Joined: 2017-09-12 17:57

Re: Multiplatform (Linux)

Post by palinka » 2020-12-09 23:24

SorenR wrote:
2020-12-06 13:51
DigDug wrote:
2020-12-06 09:35
The COM API is used for automation, I presume?

That's something that wxWidgets does not support, or only in a limited fashion since it's inherently tied to Windows.
Without the COM API you cannot control, diagnose or configure hMailServer. The GUI do not access the database.
Information is cached by hMailServer thus any configuration changes done in the database will not come into effect until you restart the server.
Forgive my ignorance, but couldn't COM be replaced entirely by json?

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

Re: Multiplatform (Linux)

Post by SorenR » 2020-12-10 02:19

palinka wrote:
2020-12-09 23:24
SorenR wrote:
2020-12-06 13:51
DigDug wrote:
2020-12-06 09:35
The COM API is used for automation, I presume?

That's something that wxWidgets does not support, or only in a limited fashion since it's inherently tied to Windows.
Without the COM API you cannot control, diagnose or configure hMailServer. The GUI do not access the database.
Information is cached by hMailServer thus any configuration changes done in the database will not come into effect until you restart the server.
Forgive my ignorance, but couldn't COM be replaced entirely by json?
Nope...
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
You would need something like an ORB ... Probably Corba using IIOP or GIOP as defined by OMG to make Object Request Brokers communicate between "applications"...

One instance of "our" IP billing/mediation/provisioning system we installed for an Italian ISP/Telco some 21 years ago we had different parts of it installed in four countries.
No extra components were used/installed for a complete system on a single 64 CPU HP Superdome versus a 5 or 6 piece SUN Enterprise 450 server setup. The GUI controlling the whole setup was running off a Silverstream Application Server on Windows NT (yeah, I know) as small as a Dell Latitude 386 laptop using a Java connector to Corba.

Anyways since I worked with Corba last it now supports IIOP over SSL so it is safe to roam free on the Interweb.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

palinka
Senior user
Senior user
Posts: 4455
Joined: 2017-09-12 17:57

Re: Multiplatform (Linux)

Post by palinka » 2020-12-10 03:13

SorenR wrote:
2020-12-10 02:19
palinka wrote:
2020-12-09 23:24
SorenR wrote:
2020-12-06 13:51


Without the COM API you cannot control, diagnose or configure hMailServer. The GUI do not access the database.
Information is cached by hMailServer thus any configuration changes done in the database will not come into effect until you restart the server.
Forgive my ignorance, but couldn't COM be replaced entirely by json?
Nope...
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
You would need something like an ORB ... Probably Corba using IIOP or GIOP as defined by OMG to make Object Request Brokers communicate between "applications"...

One instance of "our" IP billing/mediation/provisioning system we installed for an Italian ISP/Telco some 21 years ago we had different parts of it installed in four countries.
No extra components were used/installed for a complete system on a single 64 CPU HP Superdome versus a 5 or 6 piece SUN Enterprise 450 server setup. The GUI controlling the whole setup was running off a Silverstream Application Server on Windows NT (yeah, I know) as small as a Dell Latitude 386 laptop using a Java connector to Corba.

Anyways since I worked with Corba last it now supports IIOP over SSL so it is safe to roam free on the Interweb.
I literally did not understand a single word of that. Except OMG. :mrgreen:

But json is just text. I get that COM is a protocol, but from my user-only layman perspective, they pretty much achieve the same thing. Send an instruction, operation performed. Does the protocol really matter at all?

End user (by script or GUI) sends command to program > program updates database with instructions > program reads from database to decide what to do next. What am I missing? (in little words, please :D )

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

Re: Multiplatform (Linux)

Post by SorenR » 2020-12-10 03:49

palinka wrote:
2020-12-10 03:13
SorenR wrote:
2020-12-10 02:19
palinka wrote:
2020-12-09 23:24


Forgive my ignorance, but couldn't COM be replaced entirely by json?
Nope...
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
You would need something like an ORB ... Probably Corba using IIOP or GIOP as defined by OMG to make Object Request Brokers communicate between "applications"...

One instance of "our" IP billing/mediation/provisioning system we installed for an Italian ISP/Telco some 21 years ago we had different parts of it installed in four countries.
No extra components were used/installed for a complete system on a single 64 CPU HP Superdome versus a 5 or 6 piece SUN Enterprise 450 server setup. The GUI controlling the whole setup was running off a Silverstream Application Server on Windows NT (yeah, I know) as small as a Dell Latitude 386 laptop using a Java connector to Corba.

Anyways since I worked with Corba last it now supports IIOP over SSL so it is safe to roam free on the Interweb.
I literally did not understand a single word of that. Except OMG. :mrgreen:

But json is just text. I get that COM is a protocol, but from my user-only layman perspective, they pretty much achieve the same thing. Send an instruction, operation performed. Does the protocol really matter at all?

End user (by script or GUI) sends command to program > program updates database with instructions > program reads from database to decide what to do next. What am I missing? (in little words, please :D )
JSON is the shopping list your wife print on an A4 sheet for you, she will hand the A4 sheet to her personal ORB and the ORB will send it via IIOP to your personal ORB that in turn will give you the A4 sheet with the shopping list.

ORB means Object Request Broker.
IIOP means Internet Inter-Orb Protocol.
OMG actually means Object Management Group (omg.com I kid you not ;-) )
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
Dravion
Senior user
Senior user
Posts: 2071
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Multiplatform (Linux)

Post by Dravion » 2022-02-03 12:14

DigDug wrote:
2020-12-04 19:54
I donated a small amount since I use hMailServer for my mail server on my Windows VPS.

I'm, however, planning to move my stuff to my Raspberry Pi 400 server, but I found out that hMailServer is only available for Windows.

Why not use a cross-platform HTML interface (only on localhost or internal network IP's)? The WinForms interface can then be retired.

Also, I was surprised to find that hMailServer is written in C++. Looking at the UI I believed it to have been written in C#. I'm a C++ and C# developer by trade, but feel more comfortable with a mail server written in C# because of the automatic memory management.
From C/C++ to C# is not the best idea. IMHO
Every choice of a Programming Language comes with it's cost.
If you choose for example C#, you give a lot of control to the Language and Framework, but sometimes you need to have control of stuff.
C and C++ are battle proven on many Platforms for over 40 years and counting C# Support for Linux and Mac is not impressive.
Many features are Windows only. For example: WinForms or WPF (and a lot more).

Even Windows is not coded in C#, its mainly done in C and C++ plus a few lines of Assembler.
The same goes for MS-Office or Microsoft Server products like MS-SQL-Server or MS-Exchange.

There might be a few .NET Apps on top but never the important stuff.

I rather would implement a SMTP or IMAP Server in something like Java instead of .NET (which has succesfully been done before, for example Apache JAMES)
Just my 2 cents.

Post Reply