Sub OnHELO(oClient) progress?

Use this forum if you want to discuss a problem or ask a question related to a hMailServer beta release.
User avatar
RvdH
Senior user
Senior user
Posts: 746
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Sub OnHELO(oClient) progress?

Post by RvdH » 2018-09-27 15:28

mattg wrote:
2018-09-27 10:48
Did you create that disconnect.exe?
Yeah, i posted the code for it earlier in the other topic as a replacement for cports...can't find the specific topic though :shock:
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

insomniac2k2
Normal user
Normal user
Posts: 84
Joined: 2016-08-09 19:47

Re: Sub OnHELO(oClient) progress?

Post by insomniac2k2 » 2018-09-28 16:08

viewtopic.php?f=20&t=32739&p=206184#p206167
RvdH wrote:
2018-09-27 15:28
mattg wrote:
2018-09-27 10:48
Did you create that disconnect.exe?
Yeah, i posted the code for it earlier in the other topic as a replacement for cports...can't find the specific topic though :shock:

porcupine
Normal user
Normal user
Posts: 40
Joined: 2007-03-12 09:02

Re: Sub OnHELO(oClient) progress?

Post by porcupine » 2018-10-01 04:23

Disconnect.exe seems to be doing a good job as a work around for me, thanks.

BrettMontgomery
New user
New user
Posts: 2
Joined: 2019-04-05 11:55

Re: Sub OnHELO(oClient) progress?

Post by BrettMontgomery » 2019-04-05 12:08

Hi,

got an error when trying to download your last packages. (exception thrown in your website)

Are you planning on fixing this ?

Thank's in advance :)
Best regards,

insomniac2k2
Normal user
Normal user
Posts: 84
Joined: 2016-08-09 19:47

Re: Sub OnHELO(oClient) progress?

Post by insomniac2k2 » 2019-04-10 00:01

Same. Broken links for multiple downloads. Would love it if you could share your latest build when you find the time to fix it. :)

User avatar
ras07
Normal user
Normal user
Posts: 184
Joined: 2010-03-11 08:51

Re: Sub OnHELO(oClient) progress?

Post by ras07 » 2019-04-20 04:00

Is it possible to tell OnHELO to reply with an SMTP code other than 542? I'm thinking that 421 might be useful, probably others ...

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

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-04-20 09:38

ras07 wrote:
2019-04-20 04:00
Is it possible to tell OnHELO to reply with an SMTP code other than 542? I'm thinking that 421 might be useful, probably others ...
Result.Value = 3 will send errorcode 453 ... if it follows my initial code.
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

insomniac2k2
Normal user
Normal user
Posts: 84
Joined: 2016-08-09 19:47

Re: Sub OnHELO(oClient) progress?

Post by insomniac2k2 » 2019-04-23 19:01

This is a bit off topic, and not necessarily in an appropriate thread, but he was participating here all the same. Has there been a falling out with RvdH? The reason I ask, is because I appreciated his contributions and looked forward to his builds which included this Sub. As of recent, all downloads that he made available are no longer available, and he has been radio silent in response to it.

Don't get me wrong. I know that RvdH doesn't owe anyone anything. In fact, I can get by with what I have downloaded in the past. I am more concerned that we lost a good contributer.

Anyone know anything?

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

Re: Sub OnHELO(oClient) progress?

Post by jimimaseye » 2019-04-23 19:14

I've noted the same and know nothing more.
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
RvdH
Senior user
Senior user
Posts: 746
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Sub OnHELO(oClient) progress?

Post by RvdH » 2019-04-24 11:01

Downloads should be fixed, sorry i didn't even noticed something was wrong until you guys here made me aware of this
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

estradis
Normal user
Normal user
Posts: 143
Joined: 2014-09-09 10:47

Re: Sub OnHELO(oClient) progress?

Post by estradis » 2019-04-24 13:59

What are the arguments against including the function into the standard releases? Sub OnHELO has been around for some time now and even this thread has been active since 2006.

Wouldn't it be time to start a pull request and make the changes official?

Same question for Sub OnClientLogon, which I've seen in the forum before.

insomniac2k2
Normal user
Normal user
Posts: 84
Joined: 2016-08-09 19:47

Re: Sub OnHELO(oClient) progress?

Post by insomniac2k2 » 2019-04-24 20:15

I'm just glad your still here with us :)
RvdH wrote:
2019-04-24 11:01
Downloads should be fixed, sorry i didn't even noticed something was wrong until you guys here made me aware of this

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

Re: Sub OnHELO(oClient) progress?

Post by mattg » 2019-04-25 01:32

insomniac2k2 wrote:
2019-04-24 20:15
I'm just glad your still here with us :)
RvdH wrote:
2019-04-24 11:01
Downloads should be fixed, sorry i didn't even noticed something was wrong until you guys here made me aware of this
Ditto
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
mattg
Moderator
Moderator
Posts: 19810
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Sub OnHELO(oClient) progress?

Post by mattg » 2019-04-25 01:39

estradis wrote:
2019-04-24 13:59
Wouldn't it be time to start a pull request and make the changes official?
https://github.com/hmailserver/hmailserver/pull/150
estradis wrote:
2019-04-24 13:59
Same question for Sub OnClientLogon, which I've seen in the forum before.
Yes we should - I use this one too

pull requests are here >> https://github.com/hmailserver/hmailserver/pulls
We've been waiting for 5.7 for quite a long time

I'm seriously considering a swap to another server, and have done some testing. I'm really glad that RvdH responded above, or I would have spent time this weekend implementing the change. And I have a LOT of time committed to this forum for well over ten 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

insomniac2k2
Normal user
Normal user
Posts: 84
Joined: 2016-08-09 19:47

Re: Sub OnHELO(oClient) progress?

Post by insomniac2k2 » 2019-04-25 02:13

Should I assume that this is your most recent build (obvious question, i know..) RvdH?

I am god awful at source management. As i only code for hobby, but i have been considering hacking away at some changes that I've been wanting to make for quite some time. I believe your version is a good place to start.

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

Re: Sub OnHELO(oClient) progress?

Post by RvdH » 2019-04-25 09:13

insomniac2k2 wrote:
2019-04-25 02:13
Should I assume that this is your most recent build (obvious question, i know..) RvdH?
@insomniac2k2
5.6.8-B2437.17 i think is latest: https://d-fault.nl/files , i have a private build with updated OpenSSL libs but that isn't shared publicly (yet)

@mattg, just curious, what server you are looking into? You believe hmailserver is abandonware? Anyone heard from martin?
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
jimimaseye
Moderator
Moderator
Posts: 7953
Joined: 2011-09-08 17:48

Re: Sub OnHELO(oClient) progress?

Post by jimimaseye » 2019-04-25 13:52

Martins last activity on github was 9 months ago and on 'build' was 5 months ago.

There is a lot of issues that require addressing - done that are very important for it's future including openssl 1.1 and mysql 8 support amongst other things. It's in serious danger of being no longer viable for new users.

[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
SorenR
Senior user
Senior user
Posts: 3137
Joined: 2006-08-21 15:38
Location: Denmark

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-04-25 14:56

Dravion seems to be well into the project with (what appears to be) a working 64bit version with up-to-date SSL code.

Image
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

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

Re: Sub OnHELO(oClient) progress?

Post by Dravion » 2019-04-25 15:52

SorenR wrote:
2019-04-25 14:56
with up-to-date SSL code.
Thats right, but i can provide"the uptodate" SSL buils with OpenSSL builds max. til 12/31/2019.
At this date the OpenSSL version which is required by hMailServer will be completely out of support.

The new OpenSSL lib is OpenSSL 1.1.x which has many code breaking changes so hMailServer cannot be built with it.

The only compatible SSL replacement Library which works without Problem seems to be The OpenBSD's
UNIX-Operating System fork of old OpenSSL 1.0.2.x
Branch called LibreSSL.

Another library is WolfSSL which claims to has a OpenSSL 1.0.2.x Compatibility Layer which could be a good alternative to but i never got this so called Compatibility Layer working.

Next thing - besides MySQL8.x Problems - is the C/C++ Compiler code breaking changes beyond VS 2013. hMailServer cannot be build with newer Version of Visual Studio 2013. I really did everything and any Magic Trick i know of to built it beyond VS 2013 but the damned thing simply dont want compile!
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

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

Re: Sub OnHELO(oClient) progress?

Post by mattg » 2019-04-26 01:19

RvdH wrote:
2019-04-25 09:13
@mattg, just curious, what server you are looking into? You believe hmailserver is abandonware? Anyone heard from martin?
Probably postfix & courier, but also possibly a standalone 'cipher mail' VM
I have some linux boxes for web sites, and I do SPamAssassin checks on another one. I have a Windows VM just for hMailserver, and it (Windows, not hMailserver) is much more resource intensive. I had previously trialed running hmailserver on HyperVServer which is bare bones, on bare metal and that worked fine (including the admin GUI), but there is quite a bit that needs to be done with hMailserver as Dravion points out.

Do I think this is abondonware?
Martin's input has been limited since about 2012. For a couple of years we didn't hear anything and we were lucky enough to get Bill involved to do some development. Then Martin came back for a few months for ver 5.5 (in 2014), and Bill and Martin had some disagreements and we lost Bill, only to have Martin seem to disappear again.

Martin has really only done security related updates since 5.5 was released, with some fairly significant changes in 5.6 that were all security related.

5.7 has been promised for over 3 years >> https://www.hmailserver.com/forum/viewt ... 10&t=29686
with not much development being visible


As I said above, I have a lot of time invested here, and I'd like to see it work, but there comes a time where I need to protect my actual income, and move on to a product that continues to be updated. When I first started using hMailserver I wasn't keen on config file and Linux command line stuff, but someone told me recently that I've evolved into a grumpy old Linux Zealot. It seems that is correct.

Moving software isn't for the meek. I recently transitioned my companies invoicing from an open source PHP web based product to a commercial offering. There is no way that I'll be going back.
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: 1333
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Sub OnHELO(oClient) progress?

Post by Dravion » 2019-04-26 03:12

We can overcome the mentioned Problems with hMailServer HCD.
But even with all bloat/dead code allready removed, its still has more than 170.000 Lines of C/C++ code (core code only).

I just cant invest all my time into the Project and i think HCD's needs a few month making it compile completely,but iam pretty
confident it can be done.

In a Nutshell / Advantages:
*CMake based Buildsystem: We dont rely on Visual Studio anymore and can choose a diffrent Compiler for example :Linux-GCC
*Breaking code changes will not be a Major issue anymore
*hMailServer can run in Multiinstance mode because it doesnt depend on DCOM
*The Repo is organized on Github (Developers and Testers can join/leave the Project
*The Community can submit patches as Pullrequests

The initial Repo can be allready be found here:
https://github.com/hMailServer-ComDevs

Anyone who wish to help, can just create a Github Account and join the HCD Github Organization, so it doesnt depends
all on 1 single person.

Cons:
*Allmost any line of code needs to be modified
*We need to get rid of problematic thirdparty code.
*Code needs to be steamlined for UTF-8 any Unicode operations
*MySQL-Interface needs to be rewritten like it was done for Postgres.
*MSSQL CE needs to replaced by SQLLite (or a diffrent Flatfile SQL-DB)
*MS-SQL-Server Interface needs to be rewritten so it works with FreeTDS instead of MS-OLEDB/MS-ODBC
*Replacement for SimpleXML-Parse because its not reliable, old and in parts MS specific.
*We need a Replacement for DCOM+VBScript (for hMailAdmin and PHPWebAdmin and User Custom script)

Pro:
*The only DB-Interface we dont need to touch is Postgres - it just works on Windows, Linux and MacOS!
*DB-SQL-Scripts doesnt need to change at all. SQL-SELECT, INSERT, UPDATE, DELETE operations will work as expected
*The Boost-Framework will built just fine on Linux, MacOS and Windows (Core functions of hMailserver depends on Boost!)
*LibreSSL as replacement for OpenSSL 1.0.2.x can be built on MacOS, Windows and Linux, even if OpenSSL 1.1.x is installed.
*QT5 Admin tool needs to be written once, but works on Windows, MacOS and Windows.
*DCOM replacement code does allready exists, its called hRMS and works on top of TCP/IP v4/v6 with TLSv1.2

Ok, there is a hell lot of work todo, but i think its totally worth it.
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

estradis
Normal user
Normal user
Posts: 143
Joined: 2014-09-09 10:47

Re: Sub OnHELO(oClient) progress?

Post by estradis » 2019-04-26 09:34

mattg wrote:
2019-04-26 01:19
RvdH wrote:
2019-04-25 09:13
... Anyone heard from martin?
...
Martin's input has been limited since about 2012. For a couple of years we didn't hear anything ... Then Martin came back for a few months ... seem to disappear again.

Martin has really only done security related updates since 5.5 was released, with some fairly significant changes in 5.6 that were all security related.

5.7 has been promised for over 3 years >> https://www.hmailserver.com/forum/viewt ... 10&t=29686
with not much development being visible
...
I'm not happy to read that!

We have often considered moving to a new system due to we were never able to operate hms completely according to our requirements. Far too much had to be solved through external code and workarounds. But that's the price to pay for an open source product and we did it gladly, because in spite of all adversities, hms did its work reliably and defied all attacks so far.

But what we can't live with is the lack of further development. Our two mail servers are attack targets #1, so regular updates are essential. Since these also seem to be declining, the executive board will probably decide to replace hms.

User avatar
ras07
Normal user
Normal user
Posts: 184
Joined: 2010-03-11 08:51

Re: Sub OnHELO(oClient) progress?

Post by ras07 » 2019-04-27 05:31

Dravion wrote:
2019-04-26 03:12
Anyone who wish to help, can just create a Github Account and join the HCD Github Organization, so it doesnt depends
all on 1 single person.
...
Ok, there is a hell lot of work todo, but i think its totally worth it.
Hey, I'd be in. It's been years (ok, decades) since I did anything serous in c/c++, but I'd be up for testing, documentation, and the odd bit of grunt coding. Do we need to be invited to the HCD Github org? It looks private.

ras

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

Re: Sub OnHELO(oClient) progress?

Post by Dravion » 2019-04-27 08:32

Soinds good!

The HCD Project on Github is splitted ofi in 4
Teams. Core, Client, Testers and Documrntation
so you can choose where you wanna participate.

To join the Github HCD Organization you need to

1} Create an Gizhub Account
2) Let one of the HCD Admins know you want to join

The Teams are only visuble if you are assigned, the Code,Client, Tester, Docs Repo are visible to the Public. Right know only the Core Repo is visible because it has Conent.
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

User avatar
katip
Senior user
Senior user
Posts: 639
Joined: 2006-12-22 07:58
Location: Istanbul

Re: Sub OnHELO(oClient) progress?

Post by katip » 2019-04-27 09:03

mattg wrote:
2019-04-26 01:19
As I said above, I have a lot of time invested here, and I'd like to see it work, but there comes a time where I need to protect my actual income, and move on to a product that continues to be updated. When I first started using hMailserver I wasn't keen on config file and Linux command line stuff, but someone told me recently that I've evolved into a grumpy old Linux Zealot. It seems that is correct.
+1
frankly spoken, nowadays i'm trying to teach myself Postfix/Dovecot & co.
you know, it isn't an easy job to get things together now on a black screen, after a "Next, Next... Done" world for some decades. i must learn almost all from scratch, line by line in config files in rawest form. not just installing an iRedMail combo and pay 500 bucks/year for a fancy WebUI. nonsense. same as a 365 or Gmail "Business Plan".

i don't know if Martin will appear, maybe we'll never hear from him again - like Nico and his brilliant ClamAV builds once. anyway, i hope both are doing fine.
currently i appreciate Dravion's endeavors and have an eye on them. however, the portrait he describes isn't very promising to me, YMMV.

that said, after +10 happy years with HMS both at home and office, i have a feeling that i'm approaching a crossroad where i must choose a long term path at least for another decade. i must be prepared. particularly to what concerns our production server.
Katip
--
HMS 5.7.0-B2428-LTS-64-bit, MySQL 5.7.24, SA 3.4.2, ClamAV 0.101.2 + SaneS

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

Re: Sub OnHELO(oClient) progress?

Post by Dravion » 2019-04-27 09:45

katip wrote:
2019-04-27 09:03
mattg wrote:
2019-04-26 01:19
As I said above, I have a lot of time invested here, and I'd like to see it work, but there comes a time where I need to protect my actual income, and move on to a product that continues to be updated. When I first started using hMailserver I wasn't keen on config file and Linux command line stuff, but someone told me recently that I've evolved into a grumpy old Linux Zealot. It seems that is correct.
+1
frankly spoken, nowadays i'm trying to teach myself Postfix/Dovecot & co.
you know, it isn't an easy job to get things together now on a black screen, after a "Next, Next... Done" world for some decades. i must learn almost all from scratch, line by line in config files in rawest form. not just installing an iRedMail combo and pay 500 bucks/year for a fancy WebUI. nonsense. same as a 365 or Gmail "Business Plan".

i don't know if Martin will appear, maybe we'll never hear from him again - like Nico and his brilliant ClamAV builds once. anyway, i hope both are doing fine.
currently i appreciate Dravion's endeavors and have an eye on them. however, the portrait he describes isn't very promising to me, YMMV.

that said, after +10 happy years with HMS both at home and office, i have a feeling that i'm approaching a crossroad where i must choose a long term path at least for another decade. i must be prepared. particularly to what concerns our production server.

I run Postfix+Dovecot myself.
Its like you derscribed, its a complete diffrent approach to do things.
But you have to keep in mind, Postfix cannot do POP3 and IMAP. It only is an MTA and does SMTP only and thats it.
If you want POP3 or IMAP Postfix needs to be connected via LMTP-Networkprotocol or UNIX-Domain sockets (Shared Memory) to get things done.
Just check /etc/postfix and /etc/dovecot and you find gazillion of Configfiles and settings. Dovecot is also moving in a Lite and so called Pro
(Payware) version i dont like. Besides Dovetcot there are verry limited Options to run Postfix with IMAP Documentation and Support Mailinglists
are worst as it can be. The Peoples are arrogant and unfriendly to the max.
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

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

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-04-27 12:43

OK, total Github NOOB question here....

1: I downloaded version 5.4.2-B1964
2: I modified code and compiled
3: Original Master is modified ... How the h**l do I get my fork updated with current changes?
4: Can someone give me the 5 minute "how to" peptalk?

My changes are not that many or complex so I'm perfectly happy to re-code them, I'd just rather not do it.
I have DIFF with my changes to 5.4.2-B1964 so on a fresh fork it should be "easy" to implement. :?:

Please go easy :mrgreen: I have used CVS previously and switched to light use of SVN some 20'ish years ago for a period doing reviews on our inhouse billing system code. :roll:
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

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

Re: Sub OnHELO(oClient) progress?

Post by mattg » 2019-04-28 03:20

You've got to do a 'Pull request'

I've had to play a bit to get the start end end point where I want them, but essentially you tell the 'upstream' or source repository that you'd like to integrate your changes, and then there is discussion and hopefully acceptance by the owner.

You could in theory do a pull request to one of Dravion's builds with a bit of mucking around to get the end points right. I've done that with another software.

https://help.github.com/en/articles/cre ... ll-request
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
mattg
Moderator
Moderator
Posts: 19810
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Sub OnHELO(oClient) progress?

Post by mattg » 2019-04-28 03:27

Dravion wrote:
2019-04-27 08:32
Soinds good!

The HCD Project on Github is splitted ofi in 4
Teams. Core, Client, Testers and Documrntation
so you can choose where you wanna participate.

To join the Github HCD Organization you need to

1} Create an Gizhub Account
2) Let one of the HCD Admins know you want to join
You mean create a Github account?
I have one of those, now how do I find your HCD organisation?

Dravion, I've just 'followed' you on github, I see that you were already following me
I'm not a C++ coder, but I can play, and I'll happily help with the other areas
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: 1333
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Sub OnHELO(oClient) progress?

Post by Dravion » 2019-04-28 05:04

Hi Matt,
I invited you to the HCD Github Organzation.
You are assigned to all 4 Teams who exists.
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

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

Re: Sub OnHELO(oClient) progress?

Post by mattg » 2019-04-28 06:18

Thanks
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 00:28

SorenR wrote:
2016-08-11 17:47
Hmm... There has been a development... Something works when it really should not :mrgreen:

When I initially made this for my 5.4.2 I could not use "Result.Value" and "Result.Message" as the server would crash ... :roll:

When I ported my changes to a fresh 5.6.5-B2367 I assumed (I know... Assumption Is The Mother Of All Fuckups!) it would behave the same way but I left the code in there. Well, just played a bit with it - no errors!

Code: Select all

"DEBUG"	868	"2016-08-11 17:30:02.649"	"Executing event OnHELO"
"DEBUG"	868	"2016-08-11 17:30:02.649"	"Event completed"
"SMTPD"	868	166	"2016-08-11 17:30:02.649"	"127.0.0.1"	"SENT: 554 Whooa... Whaz' up?"

Code: Select all

   Sub OnHELO(oClient)
      Result.Message = "Whooa... Whaz' up?"
      Result.Value = 2
   End Sub
If someone wants to try it out I have a fresh compiled 5.6.5-B2367.1 "hMailServer.exe" on my webserver...
http://www.lolle.org/images/hmailserver/hmailserver.rar
Is this normal? I'm referring to the "The read operation failed" It happens after every successful OnHELO event. I'm not sure if the event was actually successful or if the bot just gets cut off because it doesn't know how to respond to the 453 message sent back to it.

Code: Select all

"DEBUG"	5952	"2019-05-01 16:15:36.721"	"TCP connection started for session 255"
"SMTPD"	5952	255	"2019-05-01 16:15:36.721"	"98.25.157.112"	"SENT: 220 mydomain.tld"
"SMTPD"	6060	255	"2019-05-01 16:15:37.033"	"98.25.157.112"	"RECEIVED: EHLO cpe-098-025-157-112.sc.res.rr.com"
"DEBUG"	6060	"2019-05-01 16:15:37.033"	"Executing event OnHELO"
"DEBUG"	6060	"2019-05-01 16:15:37.049"	"Event completed"
"SMTPD"	6060	255	"2019-05-01 16:15:37.049"	"98.25.157.112"	"SENT: 453 530 CODE10 Your access to this mail system has been rejected due to the sending MTA's poor reputation. If you believe that this failure is in error, please contact the intended recipient via alternate means."
"DEBUG"	5952	"2019-05-01 16:15:37.236"	"The read operation failed. Bytes transferred: 0 Remote IP: 98.25.157.112, Session: 255, Code: 2, Message: End of file"
"DEBUG"	5952	"2019-05-01 16:15:37.236"	"Ending session 255"

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

Re: Sub OnHELO(oClient) progress?

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

I get lots of them

I think they are just the bot stopping mid connection ungracefully. I think that sometimes the connections are still there waiting to be closed.
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: 1333
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Sub OnHELO(oClient) progress?

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

palinka wrote:
2019-05-02 00:28

Is this normal? I'm referring to the "The read operation failed" It happens after every successful OnHELO event. I'm not sure if the event was actually successful or if the bot just gets cut off because it doesn't know how to respond to the 453 message sent back to it.

Code: Select all

"DEBUG"	5952	"2019-05-01 16:15:36.721"	"TCP connection started for session 255"
"SMTPD"	5952	255	"2019-05-01 16:15:36.721"	"98.25.157.112"	"SENT: 220 mydomain.tld"
"SMTPD"	6060	255	"2019-05-01 16:15:37.033"	"98.25.157.112"	"RECEIVED: EHLO cpe-098-025-157-112.sc.res.rr.com"
"DEBUG"	6060	"2019-05-01 16:15:37.033"	"Executing event OnHELO"
"DEBUG"	6060	"2019-05-01 16:15:37.049"	"Event completed"
"SMTPD"	6060	255	"2019-05-01 16:15:37.049"	"98.25.157.112"	"SENT: 453 530 CODE10 Your access to this mail system has been rejected due to the sending MTA's poor reputation. If you believe that this failure is in error, please contact the intended recipient via alternate means."
"DEBUG"	5952	"2019-05-01 16:15:37.236"	"The read operation failed. Bytes transferred: 0 Remote IP: 98.25.157.112, Session: 255, Code: 2, Message: End of file"
"DEBUG"	5952	"2019-05-01 16:15:37.236"	"Ending session 255"

The read operation failed Error will occur if none or no complete Socketoperationt tool place.
It just quits the session and skips to other Connectionsjobs.

PS: Keep in Mind: hMailServer5.x uses Asynchronous Socket operations.
It means Connections gets paused and hMailServer gets back via Callback to a later point in time.
This is totally diffrent then syncronous threads which will wait without until the Job is done or a Time threshold
is reached and ther operation ins cancled. One Advantage of Asynchronous Networking is, it can handle allmost
unlimited connections while Sycronous Threads per Connection will require lots of RAM Memory and CPU Processing time.
The Problem is, events and actions doesnt work in expectable orders. In can happen that everything works as expected
but this can rapidly change if more and more Connections same time needs to be handles by hMailServer.
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 02:56

The thing is I just started using RvdH's build and I have Soren's OnHelo and OnClientConnect scripts running. I think both are possibly not working.

Here is a log sample of OnClientConnect BEFORE installing RvdH's build. Script is geolocation and IP is outside my list of acceptable countries. OnClientConnect completes and session ends. No other log entries. I looked at a few to make sure. This is very typical of the "before".

Code: Select all

"DEBUG"	11016	"2019-04-22 00:17:55.600"	"Creating session 30"
"TCPIP"	11016	"2019-04-22 00:17:55.600"	"TCP - 185.100.87.250 connected to 192.168.1.2:995."
"DEBUG"	11016	"2019-04-22 00:17:55.600"	"Executing event OnClientConnect"
"DEBUG"	11016	"2019-04-22 00:17:55.865"	"Event completed"
"DEBUG"	11016	"2019-04-22 00:19:56.365"	"Ending session 30"
Here is a sample of the same thing (IP from outside acceptable country list) from today - after installing RvdH's build.

Code: Select all

"DEBUG"	5952	"2019-05-01 19:25:08.266"	"Creating session 569"
"TCPIP"	5952	"2019-05-01 19:25:08.266"	"TCP - 170.79.73.111 connected to 192.168.1.2:25."
"DEBUG"	5952	"2019-05-01 19:25:08.266"	"Executing event OnClientConnect"
"DEBUG"	5952	"2019-05-01 19:25:08.375"	"Event completed"
"DEBUG"	5952	"2019-05-01 19:26:09.203"	"TCP connection started for session 569"
"SMTPD"	5952	569	"2019-05-01 19:26:09.203"	"127.0.0.1"	"SENT: 220 mydomain.tld"
"DEBUG"	6424	"2019-05-01 19:26:09.203"	"The write operation failed. Bytes transferred: 0 Remote IP: 127.0.0.1, Session: 569, Code: 10054, Message: An existing connection was forcibly closed by the remote host"
"DEBUG"	5952	"2019-05-01 19:26:09.203"	"Ending session 569"
Clearly the last one was not disconnected at OnClientConnect.

So the question is, using the log from the other post for a hit on OnHELO, doesn't "The read operation failed" AFTER OnHELO suggest that the connection was not terminated by the OnHELO event?

I'm using Result.Value = 1 for OnClientConnect and Result.Value = 3 for OnHELO (per another post in this thread).

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

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-05-02 08:41

Are you using the 20 second delay? That would certainly account for most of the "The write operation failed"...

I am a bit worried about this though...

Code: Select all

"The write operation failed. Bytes transferred: 0 Remote IP: 127.0.0.1, Session: 569, Code: 10054, Message: An existing connection was forcibly closed by the remote host"
Localhost bailing out on you?
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

estradis
Normal user
Normal user
Posts: 143
Joined: 2014-09-09 10:47

Re: Sub OnHELO(oClient) progress?

Post by estradis » 2019-05-02 10:22

SorenR wrote:
2019-05-02 08:41
Are you using the 20 second delay? That would certainly account for most of the "The write operation failed"...

I am a bit worried about this though...

Code: Select all

"The write operation failed. Bytes transferred: 0 Remote IP: 127.0.0.1, Session: 569, Code: 10054, Message: An existing connection was forcibly closed by the remote host"
Localhost bailing out on you?
We had a lot of errors like this, but I never figured out why. Where can I adjust that?

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

Re: Sub OnHELO(oClient) progress?

Post by Dravion » 2019-05-02 11:35

A quote from Wikipedia:


In computer science, asynchronous I/O (also non-sequential I/O) is a form of input/output processing that permits other processing to continue before the transmission has finished.
...
Asio is a freely available, open-source, cross-platform C++ library for network programming. It provides developers with a consistent asynchronous I/O model

hMailServer.exe uses ASIO for any SMTP, POP3 and IMAP Connection.

But any VBScript COM API operation is synchronously. If you try to react on a HELO SMTP
Command verb which is handled Asynchronously, you cant react on it reliable in a Synchrnous way

Thats why you get the Error Message:

"The read operation has failed".
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 12:18

SorenR wrote:
2019-05-02 08:41
Are you using the 20 second delay? That would certainly account for most of the "The write operation failed"...

I am a bit worried about this though...

Code: Select all

"The write operation failed. Bytes transferred: 0 Remote IP: 127.0.0.1, Session: 569, Code: 10054, Message: An existing connection was forcibly closed by the remote host"
Localhost bailing out on you?
Good catch. Yes, I'm using the 20 second wait, but localhost and lan are exempted. That's actually the first time i saw that issue with localhost.

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 12:24

Dravion wrote:
2019-05-02 11:35
A quote from Wikipedia:


In computer science, asynchronous I/O (also non-sequential I/O) is a form of input/output processing that permits other processing to continue before the transmission has finished.
...
Asio is a freely available, open-source, cross-platform C++ library for network programming. It provides developers with a consistent asynchronous I/O model

hMailServer.exe uses ASIO for any SMTP, POP3 and IMAP Connection.

But any VBScript COM API operation is synchronously. If you try to react on a HELO SMTP
Command verb which is handled Asynchronously, you cant react on it reliable in a Synchrnous way

Thats why you get the Error Message:

"The read operation has failed".
Ok, but that doesn't explain why the OnClientConnect event was ignored.

Is RvdH's build able to disconnect when told? I saw that he posted a "disconnect.exe" ar some point in this thread. Is that a requirement for his build?

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

Re: Sub OnHELO(oClient) progress?

Post by Dravion » 2019-05-02 12:35

palinka wrote:
2019-05-02 12:24
Ok, but that doesn't explain why the OnClientConnect event was ignored.

OnClientConnect is nothing what comes from official hMailServer code.
It must been inserted by RdvH.

Bottom line is, before the first SMTP Command token is even processed, ASIO is allready in charge, it even happends before TLS negotation
tooks place or the first Bytes are read from the Socket connections (you can see it yourself in your Error Message "0 Bytes read".

This means, there was no Data from the Client avaiable to process OnClientConnect. It would be helpfull to see on what event OnClientConnect
is fired. If its an SMTP Command verb, its allready to late.
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 12:41

Dravion wrote:
2019-05-02 01:22
The Problem is, events and actions doesnt work in expectable orders. In can happen that everything works as expected
but this can rapidly change if more and more Connections same time needs to be handles by hMailServer.
I just re-read this to make sure i understand. I think possibly my question is a little muddy.

Im questioning whether RvdH's build is disconnecting when it's supposed to.

With stock hmailserver, OnClientConnect events that trigger a disconnect worked cleanly every time. You can see by my log that RvdH's build does not disconnect on a triggered OnClientConnect event. Actually the only reason i saw that was because i was actually looking to see if OnHELO triggers were disconnecting (which is the reason i installed RvdH's build). That's when i noticed the "read operation" errors and questioned whether OnHELO was actually disconnecting or not. After that i noticed that OnClientConnect was definitely not disconnecting at all when it should be.

I think either it's broken or I'm missing something required to run RvdH's build.

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 12:45

Dravion wrote:
2019-05-02 12:35
palinka wrote:
2019-05-02 12:24
Ok, but that doesn't explain why the OnClientConnect event was ignored.

OnClientConnect is nothing what comes from official hMailServer code.
It must been inserted by RdvH.

Bottom line is, before the first SMTP Command token is even processed, ASIO is allready in charge, it even happends before TLS negotation
tooks place or the first Bytes are read from the Socket connections (you can see it yourself in your Error Message "0 Bytes read".

This means, there was no Data from the Client avaiable to process OnClientConnect. It would be helpfull to see on what event OnClientConnect
is fired. If its an SMTP Command verb, its allready to late.
Sorry for cross posting. I type slow on my phone. :mrgreen:

Add soon as i can sit down at my laptop I'll post my eventhandlers.

Are you sure about OnClientConnect? It was definitely working with official hmailserver. It's Soren's script.

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

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-05-02 13:12

palinka wrote:
2019-05-02 12:45
Dravion wrote:
2019-05-02 12:35
palinka wrote:
2019-05-02 12:24
Ok, but that doesn't explain why the OnClientConnect event was ignored.

OnClientConnect is nothing what comes from official hMailServer code.
It must been inserted by RdvH.

Bottom line is, before the first SMTP Command token is even processed, ASIO is allready in charge, it even happends before TLS negotation
tooks place or the first Bytes are read from the Socket connections (you can see it yourself in your Error Message "0 Bytes read".

This means, there was no Data from the Client avaiable to process OnClientConnect. It would be helpfull to see on what event OnClientConnect
is fired. If its an SMTP Command verb, its allready to late.
Sorry for cross posting. I type slow on my phone. :mrgreen:

Add soon as i can sit down at my laptop I'll post my eventhandlers.

Are you sure about OnClientConnect? It was definitely working with official hmailserver. It's Soren's script.
I got it too... It's perfectly normal, I just don't see them in my log as I don't do "debug" :mrgreen: AND... Sub OnClientConnect(oClient) IS default hMailServer!

Code: Select all

"DEBUG"	2312		"2019-05-02 12:37:29.134"	"Creating session 2941"
"SMTPD"	2312	2941	"2019-05-02 12:37:29.134"	"185.130.56.208"	"SENT: 220 mx.acme.inc ESMTP"
"SMTPD"	2312	2941	"2019-05-02 12:37:50.446"	"185.130.56.208"	"RECEIVED: EHLO voucherholiday.icu"
"DEBUG"	2312		"2019-05-02 12:37:50.446"	"ScriptServer::FireEvent-OnHELO"
"DEBUG"	2312		"2019-05-02 12:37:51.180"	"ScriptServer:~FireEvent"
"SMTPD"	2312	2941	"2019-05-02 12:37:51.180"	"185.130.56.208"	"SENT: 554 Rejected"
"DEBUG"	2928		"2019-05-02 12:37:51.180"	"The write operation failed. Remote IP: 185.130.56.208, Session: 2941, Code: 10054, Message: An existing connection was forcibly closed by the remote host"
"DEBUG"	2080		"2019-05-02 12:37:51.180"	"The read operation failed. Bytes transferred: 0 Remote IP: 185.130.56.208, Session: 2941, Code: 10054, Message: An existing connection was forcibly closed by the remote host"
"DEBUG"	2080		"2019-05-02 12:37:51.180"	"Ending session 2941"
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 13:27

SorenR wrote:
2019-05-02 13:12
I got it too... It's perfectly normal, I just don't see them in my log as I don't do "debug" :mrgreen: AND... Sub OnClientConnect(oClient) IS default hMailServer!

Code: Select all

"DEBUG"	2312		"2019-05-02 12:37:29.134"	"Creating session 2941"
"SMTPD"	2312	2941	"2019-05-02 12:37:29.134"	"185.130.56.208"	"SENT: 220 mx.acme.inc ESMTP"
"SMTPD"	2312	2941	"2019-05-02 12:37:50.446"	"185.130.56.208"	"RECEIVED: EHLO voucherholiday.icu"
"DEBUG"	2312		"2019-05-02 12:37:50.446"	"ScriptServer::FireEvent-OnHELO"
"DEBUG"	2312		"2019-05-02 12:37:51.180"	"ScriptServer:~FireEvent"
"SMTPD"	2312	2941	"2019-05-02 12:37:51.180"	"185.130.56.208"	"SENT: 554 Rejected"
"DEBUG"	2928		"2019-05-02 12:37:51.180"	"The write operation failed. Remote IP: 185.130.56.208, Session: 2941, Code: 10054, Message: An existing connection was forcibly closed by the remote host"
"DEBUG"	2080		"2019-05-02 12:37:51.180"	"The read operation failed. Bytes transferred: 0 Remote IP: 185.130.56.208, Session: 2941, Code: 10054, Message: An existing connection was forcibly closed by the remote host"
"DEBUG"	2080		"2019-05-02 12:37:51.180"	"Ending session 2941"
Is this log from a OnHELO event or OnClientConnect event?

Did you see my example of OnClientConnect log that doesn't disconnect?

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

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-05-02 13:31

palinka wrote:
2019-05-02 13:27
SorenR wrote:
2019-05-02 13:12
I got it too... It's perfectly normal, I just don't see them in my log as I don't do "debug" :mrgreen: AND... Sub OnClientConnect(oClient) IS default hMailServer!

Code: Select all

"DEBUG"	2312		"2019-05-02 12:37:29.134"	"Creating session 2941"
"SMTPD"	2312	2941	"2019-05-02 12:37:29.134"	"185.130.56.208"	"SENT: 220 mx.acme.inc ESMTP"
"SMTPD"	2312	2941	"2019-05-02 12:37:50.446"	"185.130.56.208"	"RECEIVED: EHLO voucherholiday.icu"
"DEBUG"	2312		"2019-05-02 12:37:50.446"	"ScriptServer::FireEvent-OnHELO"
"DEBUG"	2312		"2019-05-02 12:37:51.180"	"ScriptServer:~FireEvent"
"SMTPD"	2312	2941	"2019-05-02 12:37:51.180"	"185.130.56.208"	"SENT: 554 Rejected"
"DEBUG"	2928		"2019-05-02 12:37:51.180"	"The write operation failed. Remote IP: 185.130.56.208, Session: 2941, Code: 10054, Message: An existing connection was forcibly closed by the remote host"
"DEBUG"	2080		"2019-05-02 12:37:51.180"	"The read operation failed. Bytes transferred: 0 Remote IP: 185.130.56.208, Session: 2941, Code: 10054, Message: An existing connection was forcibly closed by the remote host"
"DEBUG"	2080		"2019-05-02 12:37:51.180"	"Ending session 2941"
Is this log from a OnHELO event or OnClientConnect event?

Did you see my example of OnClientConnect log that doesn't disconnect?
If it is a really nasty BOT they can be really difficult to get rid of. As per RFC the caller has to hang up, you cannot kick them out ... or can you :twisted:

Code: Select all

Function Disconnect(strIP)
   Const WshRunning = 0
   Const WshFinished = 1
   Const WshFailed = 2
   Dim strOut
   Dim oShell : Set oShell = CreateObject("WScript.Shell")
   Dim oExec : Set oExec = oShell.Exec("CPorts /close * * " & strIP & " *")
   Result.Value = 1
   While oExec.Status = WshRunning
      Wait(1)
   Wend
   If oExec.Status = WshFailed Then
      strOut = oExec.StdErr.ReadAll
   Else
      strOut = oExec.StdOut.ReadAll
   End If
   Set oExec = Nothing
   Set oShell = Nothing
End Function
https://www.nirsoft.net/utils/cports.html
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 13:45

Im sorry, you'll have to pardon my ignorance, but i just can't get over the difference between these two examples. Bear in mind - they are typical examples.

Official hmailserver:

Code: Select all

"DEBUG"	11016	"2019-04-22 00:17:55.600"	"Creating session 30"
"TCPIP"	11016	"2019-04-22 00:17:55.600"	"TCP - 185.100.87.250 connected to 192.168.1.2:995."
"DEBUG"	11016	"2019-04-22 00:17:55.600"	"Executing event OnClientConnect"
"DEBUG"	11016	"2019-04-22 00:17:55.865"	"Event completed"
"DEBUG"	11016	"2019-04-22 00:19:56.365"	"Ending session 30"
RvdH's build:

Code: Select all

"DEBUG"	5952	"2019-05-01 19:25:08.266"	"Creating session 569"
"TCPIP"	5952	"2019-05-01 19:25:08.266"	"TCP - 170.79.73.111 connected to 192.168.1.2:25."
"DEBUG"	5952	"2019-05-01 19:25:08.266"	"Executing event OnClientConnect"
"DEBUG"	5952	"2019-05-01 19:25:08.375"	"Event completed"
"DEBUG"	5952	"2019-05-01 19:26:09.203"	"TCP connection started for session 569"
"SMTPD"	5952	569	"2019-05-01 19:26:09.203"	"127.0.0.1"	"SENT: 220 mydomain.tld"
"DEBUG"	6424	"2019-05-01 19:26:09.203"	"The write operation failed. Bytes transferred: 0 Remote IP: 127.0.0.1, Session: 569, Code: 10054, Message: An existing connection was forcibly closed by the remote host"
"DEBUG"	5952	"2019-05-01 19:26:09.203"	"Ending session 569"
Clearly the last one was not disconnected at OnClientConnect. Before wasd clean every time. After is - well, I'm not exactly sure what to make of it. To me it looks like it just doesn't work.

Also, notice a full minute has passed when it should be either 20 or 40 seconds (have to check my event handlers to see where the wait functions are).

Also, maybe i copied the wrong log lines, but why does the connection go from 192.. to 127...? That's something i never saw before either.

I don't mean to beat a dead horse, but something definitely is not right.

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

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-05-02 14:01

OnClientConnect only support Result.Value = 1 and it should show as "SENT: 554 Rejected" in your SMTP log.

Using the 20 second delay will mostly result in the "caller" disconnecting if "caller" is not a normal mailserver. BOT's make money, time is money and the 20 second delay will cause them to loose money - thus they disconnect the hard way.
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 14:16

SorenR wrote:
2019-05-02 14:01
OnClientConnect only support Result.Value = 1 and it should show as "SENT: 554 Rejected" in your SMTP log.

Using the 20 second delay will mostly result in the "caller" disconnecting if "caller" is not a normal mailserver. BOT's make money, time is money and the 20 second delay will cause them to loose money - thus they disconnect the hard way.
I modified your original script to use a different geoip lookup service because it was throwing too many null responses.

OnClientConnect

Code: Select all

   If Lookup(strBase, oGeoip("countryCode")) Then
      Result.Value = 0
	  EventLog.Write(strPort & " Connection accepted" & Chr(34) & vbTab & oClient.IPAddress & vbTab & Chr(34) & oGeoip("countryCode") & Chr(34) & vbTab & Chr(34) & oGeoip("country") & Chr(34))
      Exit Sub
   Else
      Result.Value = 1
      EventLog.Write(strPort & " Connection REJECTED" & Chr(34) & vbTab & oClient.IPAddress & vbTab & Chr(34) & oGeoip("countryCode") & Chr(34) & vbTab & Chr(34) & oGeoip("country") & Chr(34))
   End If


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

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-05-02 14:28

palinka wrote:
2019-05-02 14:16
SorenR wrote:
2019-05-02 14:01
OnClientConnect only support Result.Value = 1 and it should show as "SENT: 554 Rejected" in your SMTP log.

Using the 20 second delay will mostly result in the "caller" disconnecting if "caller" is not a normal mailserver. BOT's make money, time is money and the 20 second delay will cause them to loose money - thus they disconnect the hard way.
I modified your original script to use a different geoip lookup service because it was throwing too many null responses.

OnClientConnect

Code: Select all

   If Lookup(strBase, oGeoip("countryCode")) Then
      Result.Value = 0
	  EventLog.Write(strPort & " Connection accepted" & Chr(34) & vbTab & oClient.IPAddress & vbTab & Chr(34) & oGeoip("countryCode") & Chr(34) & vbTab & Chr(34) & oGeoip("country") & Chr(34))
      Exit Sub
   Else
      Result.Value = 1
      EventLog.Write(strPort & " Connection REJECTED" & Chr(34) & vbTab & oClient.IPAddress & vbTab & Chr(34) & oGeoip("countryCode") & Chr(34) & vbTab & Chr(34) & oGeoip("country") & Chr(34))
   End If

Oh man... That was sooooo long ago... Anyways, it does not make sense to do "Exit Sub" on "Result.Value = 0", it would make more sense to do "Exit Sub" on "Result.Value = 1" ... BECAUSE:

hMailServer cannot act on Result.Value until the subroutine ends and control is returned to core code. Like when your wife/mom/partner tells you to go out with the trash NOW ... and continues to talk to you... Yeah I know... A rock and a hard place...

Result.Value = 1 (or 2 or 3) tell hMailServer to reject the connection with or without a custom message.
Result.Value = 0 simply means all is good, business as usual.
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

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

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-05-02 14:39

Found the code...

If it's the last ting that goes on in "Sub OnClientConnect(oClient)" then the "Exit Sub" is not needed...

Oh and...

Code: Select all

   strBase = "^(US|CA|GB|BE|DK|FR|GR|GL|IS|IE|IT|LI|NO|PL|PT|RO|SK|SI|ES|SE)$"
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 15:44

oy vey! Sorry for hijacking the thread with my poor scripting! :oops: But that explains everything.

So It should be like this instead? If connection from "good" country, go ahead and process; if from "bad" country, disconnect. I reversed your script for reasons I wrote in the other thread.

Code: Select all

   strBase = "^(US)$|^(HU)$"
   If Lookup(strBase, oGeoip("countryCode")) Then
	  EventLog.Write(strPort & " Connection accepted" & Chr(34) & vbTab & oClient.IPAddress & vbTab & Chr(34) & oGeoip("countryCode") & Chr(34) & vbTab & Chr(34) & oGeoip("country") & Chr(34))
      Exit Sub
   End If

   Result.Value = 1
   EventLog.Write(strPort & " Connection REJECTED" & Chr(34) & vbTab & oClient.IPAddress & vbTab & Chr(34) & oGeoip("countryCode") & Chr(34) & vbTab & Chr(34) & oGeoip("country") & Chr(34))

End Sub

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 15:50

SorenR wrote:
2019-05-02 14:01
OnClientConnect only support Result.Value = 1 and it should show as "SENT: 554 Rejected" in your SMTP log.
I never saw this before. I just checked my old logs for a few randomly and that message never showed up, but the connection was definitely dropped.

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

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-05-02 16:12

palinka wrote:
2019-05-02 15:44
oy vey! Sorry for hijacking the thread with my poor scripting! :oops: But that explains everything.

So It should be like this instead? If connection from "good" country, go ahead and process; if from "bad" country, disconnect. I reversed your script for reasons I wrote in the other thread.

Code: Select all

   strBase = "^(US)$|^(HU)$"
   If Lookup(strBase, oGeoip("countryCode")) Then
	  EventLog.Write(strPort & " Connection accepted" & Chr(34) & vbTab & oClient.IPAddress & vbTab & Chr(34) & oGeoip("countryCode") & Chr(34) & vbTab & Chr(34) & oGeoip("country") & Chr(34))
      Exit Sub
   End If

   Result.Value = 1
   EventLog.Write(strPort & " Connection REJECTED" & Chr(34) & vbTab & oClient.IPAddress & vbTab & Chr(34) & oGeoip("countryCode") & Chr(34) & vbTab & Chr(34) & oGeoip("country") & Chr(34))

End Sub
Yup ... and ... "^(US|HU)$" = "^(US)$|^(HU)$"
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

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

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-05-02 16:24

palinka wrote:
2019-05-02 15:50
SorenR wrote:
2019-05-02 14:01
OnClientConnect only support Result.Value = 1 and it should show as "SENT: 554 Rejected" in your SMTP log.
I never saw this before. I just checked my old logs for a few randomly and that message never showed up, but the connection was definitely dropped.
Searched logs back to 2011... Aparently it only says so when debug logging is enabled.
I do have a few non-debug logs with "SENT: 554 Rejected - Message containing bare LF's." but that's another matter.
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-02 18:38

Weird. Nothing worked. Finally I uninstalled and reinstalled official 5.6.7-b2425 hmailserver. Now its working again (OnClientConnect).

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

Re: Sub OnHELO(oClient) progress?

Post by RvdH » 2019-05-03 11:03

palinka wrote:
2019-05-02 18:38
Weird. Nothing worked. Finally I uninstalled and reinstalled official 5.6.7-b2425 hmailserver. Now its working again (OnClientConnect).
So conclusion? You f***ked up your scripting, and still you need to rollback to the official build? That doesn't make sense :!: :?:
Nothing is changed in OnClientConnect so I refuse to believe that any of my custom builds here causes the behavior 'only' you seem to have issues with
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
jimimaseye
Moderator
Moderator
Posts: 7953
Joined: 2011-09-08 17:48

Re: Sub OnHELO(oClient) progress?

Post by jimimaseye » 2019-05-03 11:11

Now its (back) working, the final test would be to put back in the mod version again to see if the problem returns.
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

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

Re: Sub OnHELO(oClient) progress?

Post by palinka » 2019-05-03 12:45

RvdH wrote:
2019-05-03 11:03
palinka wrote:
2019-05-02 18:38
Weird. Nothing worked. Finally I uninstalled and reinstalled official 5.6.7-b2425 hmailserver. Now its working again (OnClientConnect).
So conclusion? You f***ked up your scripting, and still you need to rollback to the official build? That doesn't make sense :!: :?:
Nothing is changed in OnClientConnect so I refuse to believe that any of my custom builds here causes the behavior 'only' you seem to have issues with
:oops: Yes. :oops:

But wait there's more! :mrgreen: I mixed versions. Not sure if that causes any strange behavior.

And yes, i did put the mod version back in place and everything is ok. My bad. All is fine now. Sorry for hijacking the thread.

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

Re: Sub OnHELO(oClient) progress?

Post by SorenR » 2019-05-03 12:58

I have tried killing a perfectly fine and functioning hMailServer with a (in my humble opinion) innocent script... It ocurred totally random from anywhere between 30 minutes and 8 hours.

I used the "include" function to add code to the body (not functions or subroutines) of EventHandlers.vbs. It was the Alpha version of my XML lists.

Server would start acting erratic, functions would stop working - then work and then stop - and memory stayed within normal range. Eventually the server would stall into some unexplained loop.

Since then I reverted back to only having Constant declarations, Funcions and Subroutines in the body of EventHandlers.vbs.
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

Post Reply