DCOM_RemoteEnabler

This section contains user-submitted tutorials.
Post Reply
User avatar
Dravion
Senior user
Senior user
Posts: 1435
Joined: 2015-09-26 11:50
Location: Germany
Contact:

DCOM_RemoteEnabler

Post by Dravion » 2017-07-24 20:45

This VBScript will set the needed Registry settings on your hMailServer Computer which is required for accessing
hMailServer via DCOM Remotely (Grants access for hMailAdmin, VB.NET, C#, native C++ Apps ect)

1) Open Windows Command prompt as Administrator
2) run: "wscript EnableDCOM_for_HMS.vbs"

Additionally you may need a special Windows Useraccount on both machines, same name, same password.
Attachments
EnableDCOM_for_HMS.7z
(390 Bytes) Downloaded 157 times

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

Re: DCOM_RemoteEnabler

Post by SorenR » 2017-07-25 15:16

Nice, have been waiting for something like this...

Not that I need it myself as I have been using DCOM since 2007 on my headless W2K2003 Server.

I'm still waiting for someone to make a complete set of HMS-plugins for RoundCube on UNIX using either a port of DCOM or a gateway of some sorts. :mrgreen:
SørenR.

“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde

tunis
Normal user
Normal user
Posts: 224
Joined: 2015-01-05 20:22
Location: Sweden

Re: DCOM_RemoteEnabler

Post by tunis » 2017-07-25 18:10

SorenR wrote: I'm still waiting for someone to make a complete set of HMS-plugins for RoundCube on UNIX using either a port of DCOM or a gateway of some sorts. :mrgreen:
My plugin for roundcube on UNIX using api that use php on mail server. https://plugins.roundcube.net/users/tunis78/packages/
I self run hmailserver on 2016-core with nginx and php for the api (and phpwebadmin) and centos with apache and php with roundecube.
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

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

Re: DCOM_RemoteEnabler

Post by SorenR » 2017-07-26 00:05

The thing is i don't want a webserver on my mailserver.
SørenR.

“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde

tunis
Normal user
Normal user
Posts: 224
Joined: 2015-01-05 20:22
Location: Sweden

Re: DCOM_RemoteEnabler

Post by tunis » 2017-07-29 20:54

SorenR wrote:The thing is i don't want a webserver on my mailserver.
I have make a gateway test with the small REST server Grapevine, combined with Dravion example viewtopic.php?f=21&t=31507.

It can only get and set users forwarding and show version of hmailserver for now.

Run hmailRESTServer.exe.
Connect to and show version: localhost:1234/version
Get forwarding: localhost:1234/user/forwarding?email=email&password=password
Save forwarding: localhost:1234/user/forwarding/save?email=email&password=password&enable=1&address=test@test.local&keeporiginal=1

This is just a test.
Attachments
hmailRESTServer.7z
(175.12 KiB) Downloaded 78 times
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

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

Re: DCOM_RemoteEnabler

Post by Dravion » 2017-07-29 21:26

tunis wrote:
SorenR wrote:The thing is i don't want a webserver on my mailserver.
I have make a gateway test with the small REST server Grapevine, combined with Dravion example viewtopic.php?f=21&t=31507.

It can only get and set users forwarding and show version of hmailserver for now.

Run hmailRESTServer.exe.
Connect to and show version: localhost:1234/version
Get forwarding: localhost:1234/user/forwarding?email=email&password=password
Save forwarding: localhost:1234/user/forwarding/save?email=email&password=password&enable=1&address=test@test.local&keeporiginal=1

This is just a test.
Nice work tunis :)
I think the more ways of accessing hMailServer the better.

IMHO:
REST is nice and back in time i made a QT5 Client which accessed Apach2+PHP via Rest (server rest part was done in PHP) but then i realized this requires a Webserver, PHP5 and even SSL and anything needs to configured properly...

Here is my old posting about it, maybe its a help in someway for your Project
viewtopic.php?f=8&t=29979&p=187419&hilit=rest#p187419

Long story short: I decided to start a new Windows TCP/IP-Server Project which runs as Windows Service
(side by side with hMailServer.exe) which is permanently connected via DCOM to it while at the same time has a TCP/IP based SSL/TLS Remote API for Internet and Local Area Network access (plain and simple).

Declan, a diffrent User made the request for this project because he wants to access hMailServer from its own Android .x (or higher) Smartphone App (with Java +SSL). Its planned that C/C++ and Java will be supported first,
but as time goes by other languages will be added as well. However: The more API's for hMailServer and utilities the better :wink:

tunis
Normal user
Normal user
Posts: 224
Joined: 2015-01-05 20:22
Location: Sweden

Re: DCOM_RemoteEnabler

Post by tunis » 2017-07-29 22:04

Your project looking nice!

I have also think making it a windows service. (I tried but it failed to install, so I must read how it work with installer and stuff)
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

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

Re: DCOM_RemoteEnabler

Post by RvdH » 2017-08-01 13:07

I noticed you both call oApp.Connect() before every call to specific hmailserver settings, are you sure that is needed?
I made some smaller projects using C# and I never call oApp.Connect() as the server should have connection(s) to the database already. I just tested it once more and I successfully can get and set values from within C# without calling oApp.Connect()
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

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

Re: DCOM_RemoteEnabler

Post by Dravion » 2017-08-01 14:05

Yeah its unescessary

Post Reply