HCD: VBScript Support for hMailServer Crossplatform

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
User avatar
Dravion
Senior user
Senior user
Posts: 1492
Joined: 2015-09-26 11:50
Location: Germany
Contact:

HCD: VBScript Support for hMailServer Crossplatform

Post by Dravion » 2019-05-01 11:13

Aa some of you know i try to port hMailServer 5.7.0 to Windows 64-Bit, Linux 64-Bit and MacOS 64-Bit

Description
The HCD (H MailServer C ommunity D evelopers) - Project is intended to be a Community drivven Project
and democratically organized. The Main focus relies on our Github Repository and anyone which as a Github Account can apply for invitation.
As you might know, there is a a lot todo and experienced helpers (or willing to learn youngsters) are allways wellcome.
Checkout our Github Project site: https://github.com/hMailServer-ComDevs

Ok, now to the Featurerequest and your opinion about it:

Situation:
hMailServer official and LTS providing VBScript Support (while HCD natively supports only LUA Scripts) which is used by a lot hMailServer
Experts for various tasks and even tasks beyond hMailServer. As you might know, VBScript is based on COM (Microsoft Component Object Model, formerly know as DDE, OLE, ActiveX, DCOM, COM+, WDNA ect. - in short COM) which is only avaiable on Microsoft Windows. The WINE Project (a Linux, MacOS and UNIX-Co,patibility Library, not an Emulator) provides "some" support of most Windows XP specific Objects referenced in Windows, so some Scripts can run (idenpendently of hMailServer) . A VB-Script call on Linux or MacOS could look like this (on a Mac/Linux Terminal prompt: wine cscript "myscript.vbs" ).

hMailServer (official and LTS) supporting two VB-Script scenarios:
1) Running a script from outside hMailServer by access hMailServer COM API (or any other COM-Object)
2) Running VB-Scripts invoked by hMailServers Eventhandler.vbs (running inside the hMailServer.exe Service Process)

While scenario 1 could be allmost easily archived by good old WINE itself, scenario 2 is more tricky and needs more in depth analysis.
Maybe its possible to invoke wine cscript "myscript.vbs" in the background but this need to be tested.

Main focus: HCD on Windows and VB-Script
Allmost 100% of all existing VBScript Users are running Scripts on Windows (mainly from Windows XP SP3 upto Windows 10,
or Windows Server 2003 upto Windows Server 2019). Its completely sane to expect such VB-Script users might want to
continue VBScripting on Windows, but regarding HCD we have to pick and chosse how this can be made possible.

HCD main Development platform right now is Linux and its C/C++ Compiler GNU GCC.
GCC doesnt understand COM or VBScript so we cant VBScripting support by the GCC C/C++ Compiler itself but we will
have a Console Admin client on all Operating System HCD can run on whch can call HCD's API. On top of this Console
Client, we can run our own COM API Object which can trigger Remote VBScript calls (encypted via TLSv1.2 or higher).

HCD on Windows
I my view, it all comes down to a Windows COM DLL which emulates the hMailServer 5.5.x COM API while behind the curtains
it connects to a local or remotely running hMailServer HCD Service over TCP/IP TLSv1.2 secured connection.

So, this questions goes out to all your VBScript Users. Should HCD provide support for VBScript or should we focus on
LUA? VBScript Support for HCD is extra effort and needs resources but in my view it can be done.

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

Re: HCD: VBScript Support for hMailServer Crossplatform

Post by mattg » 2019-05-01 11:20

I've heard you talk about LUA before

Can you please link to some examples and web pages about LUA - I know nothing about it

Perhaps Perl or Python, something cross platform will be better. AwStats is in Perl I think
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
Dravion
Senior user
Senior user
Posts: 1492
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: HCD: VBScript Support for hMailServer Crossplatform

Post by Dravion » 2019-05-01 12:36

Yes! LUA is the builtin Scripting Language for hMailServer HCD.

This is no offense to any other Scripting Language like Python, PHP or Perl.

The decision for LUA is because its an Crossplatform embeddable Scripting Langua which is realy tiny and doesnt
cause a lot of headache from a Integration point of view. Python, Perl and PHP are hugh (dozens of MBytes) and to
complex to support it on every Platform, thats why LUA is perfect for HCD. Thats why LUa is used heavily for example
by the Gaming Industry. Big Games like World of Warcaft using it for hugh parts of the Games but also it is used in Financial
Instution anything else where a lightweight, small, Userfriendly Scriptinglanguage is needed.

LUA is complete OpenSource and well documented

Offical Reference:
https://www.lua.org/manual/5.3/

Lots of Examples:
http://lua-users.org/wiki/FormattingNumbers

A simple "Hello World" in LUA would look like this:

1) Open a Text editor
2) Insert: print("Hello World") and save it as myscript.lua
3) Open a Command prompt and run it with "lua53.exe myscript.lua"

PS: If hMailServer is installed, it has its own builtin LUA Interpreter aboard, but if you want to play
with it standalone, you need a LUA package for example:
https://sourceforge.net/projects/luabin ... p/download

Unpack it in for examle: C:\Users\Dravion\Downloads\lua-5.3.5_Win64_bin
and inside the lua-5.3.5_Win64_bin Folder you find:
*lua53.exe (Command line version)
*wlua53.exe (runs scripts without a DOS Window)
*lua53.dll (Extension for other Programs, wishing to embedd LUA (like HCD)
*luac53.exe (a LUA Compiler, which can binary compile LUA scripts to boost peformance allmost to usual Win32 EXE App level)

Of cause, lua53.exe for example can be renamed to simply lua.exe, like its done in may Linux Distros.
you can run many diffrent LUA versions side by side without bothering or interfering with other LUA Installations.
The complete LUA Folder with all its Components are only 827 KB large.

PS2:
While LUA will run anywhere where HCD is installed, VBScript is a diffrent Beast. If you or other VBScript Guys think
we need to support it, i think we can doit side by side with LUA but if you think its not necessary, we can focus on LUA
only without VBScript. I just wanted this to be a Community decision.

User avatar
jimimaseye
Moderator
Moderator
Posts: 8175
Joined: 2011-09-08 17:48

Re: HCD: VBScript Support for hMailServer Crossplatform

Post by jimimaseye » 2019-05-01 12:38

Dravion wrote:
2019-05-01 11:13
As you might know, there is a a lot todo and experienced helpers (or willing to learn youngsters) are allways wellcome
Err... what about the willing to learn not so young folk too?

Dravion wrote:
2019-05-01 11:13
So, this questions goes out to all your VBScript Users. Should HCD provide support for VBScript or should we focus on
LUA? VBScript Support for HCD is extra effort and needs resources but in my view it can be done.
Personally I think that as the product is begging developed to continue its life with existing users then it must be backward compatible. Most users, like myself, although not coders will have found themselves needing to include or adapt vbs scripts in to their system to tailor it to their needs (a strong point of hmailserver). Such adaptations are not simple or easy especially if you are not a coder or are a newbie to hms. Existing hms had LOTS (a forum full) of scripts in vbs which will only be translatable to (chosen) brew language (python etc) by experts - not for people like me who wouldn't have a clue. Failure to provide this backward compatibility is effectively stopping these specific existing users from progressing to this new version and maintaining their existing installation and we will still effectively have 2 separate products and 2 separate user bases.

[Entered by mobile. Excuse my spelling.]
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

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

Re: HCD: VBScript Support for hMailServer Crossplatform

Post by Dravion » 2019-05-01 13:02

jimimaseye wrote:
2019-05-01 12:38
Dravion wrote:
2019-05-01 11:13
As you might know, there is a a lot todo and experienced helpers (or willing to learn youngsters) are allways wellcome
Err... what about the willing to learn not so young folk too?
Iam iam a silversurfer myself but you at heart (i hope :D)
Personally I think that as the product is begging developed to continue its life with existing users then it must be backward compatible. Most users, like myself, although not coders will have found themselves needing to include or adapt vbs scripts in to their system to tailor it to their needs (a strong point of hmailserver).
Thats a valid point and i think thats why we need to ReInvent the VBScript Wheel for HCD again.
HCD is forked from LTS 5.7.0 Codebase and internally completely changed.
I have stripped all Windows only Code fragments and functions from it (about 30.000 Lines of code) which isnt required
by the Server Core code to run.

Unfortently, this comes at some costs:
*COM API Support is removed
*VBScript Support is removed
*MS-SQL-CE Support is removed
*MySQL/MariaDB Support is removed
*Microsoft SQL-Server Support is removed

Only PosgreSQL is functional right know.

As you surely know:
VB-Scripting, PHPWebAdmin, DataDirectorySynchronizer.exe, DBQuick.exe, DBSetup.exe and any Addons\Utilies Script cannot work
without the COM API. Thats why i bring up this Feature request.
Such adaptations are not simple or easy especially if you are not a coder or are a newbie to hms. Existing hms had LOTS (a forum full) of scripts in vbs which will only be translatable to (chosen) brew language (python etc) by experts - not for people like me who wouldn't have a clue. Failure to provide this backward compatibility is effectively stopping these specific existing users from progressing to this new version and maintaining their existing installation and we will still effectively have 2 separate products and 2 separate user bases.
Ok, i see. We need VBScript support for HCD besides LUA Support as well.
Not an easy task but i think it can be done.

PS: If we need a COM API for Windows Users in HCD we can use hMailAdmin.exe, and PHPWebAdmin, DBSetup.exe, DBQuick.exe and DataDirectorySynchronizer.exe as well. Only the Linux and MacOS Installations needs to be configured in the terminal. I think this could
save lots of time in the first place.

mats
New user
New user
Posts: 26
Joined: 2018-05-06 20:58

Re: HCD: VBScript Support for hMailServer Crossplatform

Post by mats » 2019-11-23 21:42

late to the show but I say powershell.

- It's multiplatform and open source
- since it can interface .net it will give a lot of flexibility and capability
- it will do com calls too

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

Re: HCD: VBScript Support for hMailServer Crossplatform

Post by palinka » 2019-11-24 01:12

I like powershell too. :D

Post Reply