Weird error cause minidumps with 5.6.8-B2555.Custom

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
User avatar
SorenR
Senior user
Senior user
Posts: 4706
Joined: 2006-08-21 15:38
Location: Denmark

Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-05-29 11:31

I have been getting loads of minidumps on IMAP since yesterday and the culprit is one specific iPhone 12.. It's not a new phone, it been in our household for a while and it's using the built-in email client.

Phone is not available for debugging as it flew on vacation to Spain this morning with it's owner :roll:

1: Existing client software for over 1 year
2: Email user access same account from iPhone, iPad, HP laptop, Huawei laptop and Roundcube webmail.
3: Internal IP or External IP no difference
4: IMAP is accessed via SSL (not STARTTLS)
5: hMailServer SSL/TLS is set to ONLY (!) accept TLS 1.2 and 1.3
6: Server is Windows Server 2003 R2 and has been hosting hMailServer since 2006.

Loading the minidump file into 'Visual Studio Community 2013 Update 5' and running debug point me to "ssl3_record.c" line 529 (openssl-1.1.1k).
Not sure if it is 100% correct as VS2013 says it cannot find the PDB of hMailServer.exe ...

openssl-1.1.1k is compiled with "enable-weak-ssl-ciphers" - it seems this option is removed on 5.7 - why?

Code: Select all

"ERROR"	1220	"2021-05-29 04:16:08.323"	"Severity: 3 (Medium), Code: HM5136, Source: TCPConnection::AsyncReadCompleted, Description: An error occured while parsing data. Data length: 47, Data: 15 UID FETCH 35843 BODY.PEEK[]<2226.4294967295>. Remote IP: 62.44.135.74"
"ERROR"	1220	"2021-05-29 04:16:08.338"	"Severity: 2 (High), Code: HM4208, Source: ExceptionHandler::Run, Description: An error occured while executing 'IOCPQueueWorkerTask'"
"ERROR"	1220	"2021-05-29 04:16:08.494"	"Severity: 1 (Critical), Code: HM5519, Source: StackLogger::Log, Description: An error has been detected. A mini dump has been written to C:\hMailServer\Logs\minidump_2021-05-29 041608_{4AEC1AAA-5A1D-4AC9-AF85-23E24FC60CB8}.dmp"
"ERROR"	1528	"2021-05-29 04:16:14.963"	"Severity: 3 (Medium), Code: HM5136, Source: TCPConnection::AsyncReadCompleted, Description: An error occured while parsing data. Data length: 46, Data: 7 UID FETCH 35843 BODY.PEEK[]<2226.4294967295>. Remote IP: 62.44.135.74"
"ERROR"	1528	"2021-05-29 04:16:14.979"	"Severity: 2 (High), Code: HM4208, Source: ExceptionHandler::Run, Description: An error occured while executing 'IOCPQueueWorkerTask'"
"ERROR"	1528	"2021-05-29 04:16:15.057"	"Severity: 1 (Critical), Code: HM5519, Source: StackLogger::Log, Description: An error has been detected. A mini dump has been written to C:\hMailServer\Logs\minidump_2021-05-29 041614_{1BFBE73F-DE7F-4F5B-A732-AEABEA1B9B65}.dmp"
"ERROR"	3776	"2021-05-29 04:19:48.834"	"Severity: 3 (Medium), Code: HM5136, Source: TCPConnection::AsyncReadCompleted, Description: An error occured while parsing data. Data length: 46, Data: 6 UID FETCH 35843 BODY.PEEK[]<2226.4294967295>. Remote IP: 62.44.135.74"
"ERROR"	3776	"2021-05-29 04:19:48.850"	"Severity: 2 (High), Code: HM4208, Source: ExceptionHandler::Run, Description: An error occured while executing 'IOCPQueueWorkerTask'"
"ERROR"	3776	"2021-05-29 04:19:48.928"	"Severity: 1 (Critical), Code: HM5519, Source: StackLogger::Log, Description: An error has been detected. A mini dump has been written to C:\hMailServer\Logs\minidump_2021-05-29 041948_{9FF28F05-77D7-4182-A511-BA42FA530554}.dmp"
"ERROR"	1180	"2021-05-29 06:23:44.831"	"Severity: 3 (Medium), Code: HM5136, Source: TCPConnection::AsyncReadCompleted, Description: An error occured while parsing data. Data length: 47, Data: 44 UID FETCH 35846 BODY.PEEK[]<2308.4294967295>. Remote IP: 62.44.138.202"
"ERROR"	1180	"2021-05-29 06:23:44.847"	"Severity: 2 (High), Code: HM4208, Source: ExceptionHandler::Run, Description: An error occured while executing 'IOCPQueueWorkerTask'"
"ERROR"	1180	"2021-05-29 06:23:44.925"	"Severity: 1 (Critical), Code: HM5519, Source: StackLogger::Log, Description: An error has been detected. A mini dump has been written to C:\hMailServer\Logs\minidump_2021-05-29 062344_{E2CACAB5-CEA0-44FE-8502-F2EF0E3FF0AD}.dmp"
"ERROR"	3776	"2021-05-29 06:23:48.300"	"Severity: 3 (Medium), Code: HM5136, Source: TCPConnection::AsyncReadCompleted, Description: An error occured while parsing data. Data length: 47, Data: 41 UID FETCH 35846 BODY.PEEK[]<2308.4294967295>. Remote IP: 62.44.138.202"
"ERROR"	3776	"2021-05-29 06:23:48.315"	"Severity: 2 (High), Code: HM4208, Source: ExceptionHandler::Run, Description: An error occured while executing 'IOCPQueueWorkerTask'"
"ERROR"	3776	"2021-05-29 06:23:48.409"	"Severity: 1 (Critical), Code: HM5519, Source: StackLogger::Log, Description: An error has been detected. A mini dump has been written to C:\hMailServer\Logs\minidump_2021-05-29 062348_{DB77056D-D4CC-4593-86DF-78A7C6059353}.dmp"
"ERROR"	1156	"2021-05-29 09:18:37.877"	"Severity: 3 (Medium), Code: HM5136, Source: TCPConnection::AsyncReadCompleted, Description: An error occured while parsing data. Data length: 49, Data: 18 UID FETCH 35850 BODY.PEEK[]<116644.4294967295>. Remote IP: 62.44.138.175"
"ERROR"	1156	"2021-05-29 09:18:37.877"	"Severity: 2 (High), Code: HM4208, Source: ExceptionHandler::Run, Description: An error occured while executing 'IOCPQueueWorkerTask'"
"ERROR"	1156	"2021-05-29 09:18:37.970"	"Severity: 1 (Critical), Code: HM5519, Source: StackLogger::Log, Description: An error has been detected. A mini dump has been written to C:\hMailServer\Logs\minidump_2021-05-29 091837_{097A7587-D1DB-444D-921C-976B0B6D30A4}.dmp"
"ERROR"	2668	"2021-05-29 09:19:13.141"	"Severity: 3 (Medium), Code: HM5136, Source: TCPConnection::AsyncReadCompleted, Description: An error occured while parsing data. Data length: 48, Data: 6 UID FETCH 35850 BODY.PEEK[]<116644.4294967295>. Remote IP: 62.44.138.175"
"ERROR"	2668	"2021-05-29 09:19:13.157"	"Severity: 2 (High), Code: HM4208, Source: ExceptionHandler::Run, Description: An error occured while executing 'IOCPQueueWorkerTask'"
"ERROR"	2668	"2021-05-29 09:19:13.251"	"Severity: 1 (Critical), Code: HM5519, Source: StackLogger::Log, Description: An error has been detected. A mini dump has been written to C:\hMailServer\Logs\minidump_2021-05-29 091913_{65BE5481-A6FC-43AE-A5DA-56CB79451789}.dmp"

Code: Select all

"TCPIP"	2716	"2021-05-29 09:19:13.126"	"TCPConnection - TLS/SSL handshake completed. Session Id: 214, Remote IP: 62.44.138.175, Version: TLSv1.3, Cipher: TLS_AES_128_GCM_SHA256, Bits: 128"
"IMAPD"	2716	214	"2021-05-29 09:19:13.126"	"62.44.138.175"	"SENT: * OK IMAPrev1"
"IMAPD"	2668	213	"2021-05-29 09:19:13.141"	"62.44.138.175"	"RECEIVED: 6 UID FETCH 35850 BODY.PEEK[]<116644.4294967295>"
"ERROR"	2668	"2021-05-29 09:19:13.141"	"Severity: 3 (Medium), Code: HM5136, Source: TCPConnection::AsyncReadCompleted, Description: An error occured while parsing data. Data length: 48, Data: 6 UID FETCH 35850 BODY.PEEK[]<116644.4294967295>. Remote IP: 62.44.138.175"
"DEBUG"	2668	"2021-05-29 09:19:13.157"	"Executing event OnError"
"DEBUG"	2668	"2021-05-29 09:19:13.157"	"Event completed"
"DEBUG"	2668	"2021-05-29 09:19:13.157"	"Ending session 213"
"ERROR"	2668	"2021-05-29 09:19:13.157"	"Severity: 2 (High), Code: HM4208, Source: ExceptionHandler::Run, Description: An error occured while executing 'IOCPQueueWorkerTask'"
"DEBUG"	2668	"2021-05-29 09:19:13.157"	"Executing event OnError"
"DEBUG"	2668	"2021-05-29 09:19:13.173"	"Event completed"
"DEBUG"	2668	"2021-05-29 09:19:13.173"	"Logging exception.."
"IMAPD"	1308	211	"2021-05-29 09:19:13.251"	"62.44.138.175"	"RECEIVED: 13 UID SEARCH 1:* DELETED"
"IMAPD"	1308	211	"2021-05-29 09:19:13.251"	"62.44.138.175"	"SENT: * SEARCH 35837"
"ERROR"	2668	"2021-05-29 09:19:13.251"	"Severity: 1 (Critical), Code: HM5519, Source: StackLogger::Log, Description: An error has been detected. A mini dump has been written to C:\hMailServer\Logs\minidump_2021-05-29 091913_{65BE5481-A6FC-43AE-A5DA-56CB79451789}.dmp"
"DEBUG"	2668	"2021-05-29 09:19:13.251"	"Executing event OnError"
"IMAPD"	1308	211	"2021-05-29 09:19:13.251"	"62.44.138.175"	"SENT: 13 OK UID completed"
"DEBUG"	2668	"2021-05-29 09:19:13.251"	"Event completed"
"DEBUG"	2668	"2021-05-29 09:19:13.251"	"Completed logging of exception..."
Some of the hm_messages.messageuid's exist, others have been deleted.

I'm wondering if I should compile openssl-1.1.1k without "enable-weak-ssl-ciphers" and build a new hMailServer.exe ... :idea:
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

User avatar
johang
Senior user
Senior user
Posts: 554
Joined: 2008-09-01 09:20

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by johang » 2021-05-29 12:22

SorenR wrote:
2021-05-29 11:31
I have been getting loads of minidumps on IMAP since yesterday and the culprit is one specific iPhone 12.. It's not a new phone, it been in our household for a while and it's using the built-in email client.
ios vesrsion ?

https://discussions.apple.com/thread/252009798
5: hMailServer SSL/TLS is set to ONLY (!) accept TLS 1.2 and 1.3
this is a stupid question i know... what happens if you enable TLS 1.1 ? still minidumps ??, enable SSL 3 .. still minidumps ?
___________________________________________________________end of the line

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by RvdH » 2021-05-29 13:12

Maybe related to https://github.com/hmailserver/hmailserver/issues/334? Maybe iPhone 12 i more strict in honor the BODY.PEEK size
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
katip
Senior user
Senior user
Posts: 904
Joined: 2006-12-22 07:58
Location: Istanbul

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by katip » 2021-05-29 14:27

i experienced same problem but in reverse direction:
i used about 1 year x64 build HMS and encountered this error sequence (HMS5136 - 4208 - 5519 ending up with a minidump) almost every day - related to IMAP.
since i changed to 5.6.8 beginning of this month, this never happened again till this moment.

various cases:

Code: Select all

Description: An error occured while parsing data. Data length: 40, Data: 1721 UID FETCH 279332 (UID BODY.PEEK[1])...
Description: An error occured while parsing data. Data length: 54, Data: 404 UID FETCH...
Description: An error occured while parsing data. Data length: 31, Data: MKDD542 UID SEARCH UID...
Description: An error occured while parsing data. Data length: 11, Data: PASS...
Description: An error occured while parsing data. Data length: 13, Data: TOP 2952 1684...
Description: An error occured while parsing data. Data length: 25, Data: 1869 getquotaroot "INBOX"...
all disappeared with 5.6.8
W2K8R2-SP1, MariaDB x64
SSL/TLS all versions checked
jfyi..
Katip
--
HMS 5.7.0, MariaDB 10.4.10, SA 3.4.2, ClamAV 0.103.2

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-05-29 16:00

I have in the meantime done maintenance on my MySQL database without finding any issues ... BUT!

Phone has been online from Mallorca - Telco is smart enough to run Roaming Internet on internal VPN to identify phone as DK (Denmark) origin so it is allowed access to my server. Alternative was an ExpressVPN :mrgreen: or webmail.

No additional minidumps so far.

@RvdH Can I trust the debugging from VS2013 even with the missing PDB for hMailServer.exe?
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-05-29 16:03

johang wrote:
2021-05-29 12:22
SorenR wrote:
2021-05-29 11:31
I have been getting loads of minidumps on IMAP since yesterday and the culprit is one specific iPhone 12.. It's not a new phone, it been in our household for a while and it's using the built-in email client.
ios vesrsion ?

https://discussions.apple.com/thread/252009798
5: hMailServer SSL/TLS is set to ONLY (!) accept TLS 1.2 and 1.3
this is a stupid question i know... what happens if you enable TLS 1.1 ? still minidumps ??, enable SSL 3 .. still minidumps ?
5.6.8 don't have SSL 3.0 :wink:

I've been running TLS 1.2/1.3 ONLY for some weeks now without any issues.
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by RvdH » 2021-05-29 16:36

SorenR wrote:
2021-05-29 16:00
I have in the meantime done maintenance on my MySQL database without finding any issues ... BUT!

Phone has been online from Mallorca - Telco is smart enough to run Roaming Internet on internal VPN to identify phone as DK (Denmark) origin so it is allowed access to my server. Alternative was an ExpressVPN :mrgreen: or webmail.

No additional minidumps so far.

@RvdH Can I trust the debugging from VS2013 even with the missing PDB for hMailServer.exe?
Build a debug version, i think you will create the missing PDB in that case
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
SorenR
Senior user
Senior user
Posts: 4706
Joined: 2006-08-21 15:38
Location: Denmark

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-05-29 18:19

RvdH wrote:
2021-05-29 16:36
SorenR wrote:
2021-05-29 16:00
I have in the meantime done maintenance on my MySQL database without finding any issues ... BUT!

Phone has been online from Mallorca - Telco is smart enough to run Roaming Internet on internal VPN to identify phone as DK (Denmark) origin so it is allowed access to my server. Alternative was an ExpressVPN :mrgreen: or webmail.

No additional minidumps so far.

@RvdH Can I trust the debugging from VS2013 even with the missing PDB for hMailServer.exe?
Build a debug version, i think you will create the missing PDB in that case
Do you know why openssl should be built with "enable-weak-ssl-ciphers" for 5.6.x and not for 5.7 ?
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by RvdH » 2021-05-29 18:52

SorenR wrote:
2021-05-29 18:19
Do you know why openssl should be built with "enable-weak-ssl-ciphers" for 5.6.x and not for 5.7 ?
Not sure, guess to not have to much different accepted ciphers between 5.6.7 and 5.6.8 and as 5.7 still isn't released and we have no idea when it eventually will you might think this simply uses higher security standards
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
SorenR
Senior user
Senior user
Posts: 4706
Joined: 2006-08-21 15:38
Location: Denmark

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-05-29 19:14

RvdH wrote:
2021-05-29 18:52
SorenR wrote:
2021-05-29 18:19
Do you know why openssl should be built with "enable-weak-ssl-ciphers" for 5.6.x and not for 5.7 ?
Not sure, guess to not have to much different accepted ciphers between 5.6.7 and 5.6.8 and as 5.7 still isn't released and we have no idea when it eventually will you might think this simply uses higher security standards
I'll try to build my 5.6.8 without the "enable-weak-ssl-ciphers" and see how it goes. Since 5.6.8 no longer support SSL 3.0 it seems pointless to keep supporting 3DES ciphers.
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by RvdH » 2021-05-29 19:17

SorenR wrote:
2021-05-29 19:14
RvdH wrote:
2021-05-29 18:52
SorenR wrote:
2021-05-29 18:19
Do you know why openssl should be built with "enable-weak-ssl-ciphers" for 5.6.x and not for 5.7 ?
Not sure, guess to not have to much different accepted ciphers between 5.6.7 and 5.6.8 and as 5.7 still isn't released and we have no idea when it eventually will you might think this simply uses higher security standards
I'll try to build my 5.6.8 without the "enable-weak-ssl-ciphers" and see how it goes. Since 5.6.8 no longer support SSL 3.0 it seems pointless to keep supporting 3DES ciphers.
As you only allow TLSv1.2 and TLSv1.3 you won't notice any difference i guess, but i suspect "enable-weak-ssl-ciphers" also influences the ciphers for TLSv1 and TLSv1.1 (and not only SSLv3)
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
RvdH
Senior user
Senior user
Posts: 1506
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by RvdH » 2021-05-29 19:38

Note that RC4 based cipher suites are not built into OpenSSL by default (see the enable-weak-ssl-ciphers option to Configure).
https://www.openssl.org/docs/man1.1.1/man1/ciphers.html
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
SorenR
Senior user
Senior user
Posts: 4706
Joined: 2006-08-21 15:38
Location: Denmark

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-05-29 20:13

You should also disable weak ciphers such as DES and RC4. DES can be broken in a few hours and RC4 has been found to be weaker than previously thought. In the past, RC4 was advised as a way to mitigate BEAST attacks. However, due to the latest attacks on RC4, Microsoft has issued an advisory against it. The PCI DSS also prohibits the use of the RC4 bulk cipher.
https://www.acunetix.com/blog/articles/ ... hardening/

https://msrc-blog.microsoft.com/2013/11 ... sable-rc4/

I think I'll take the chance and try it.

Do you know of a place to verify the SSL/TLS cipher list specified in the GUI will match OpenSSL configuration?
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by RvdH » 2021-05-29 20:16

SorenR wrote:
2021-05-29 20:13
You should also disable weak ciphers such as DES and RC4. DES can be broken in a few hours and RC4 has been found to be weaker than previously thought. In the past, RC4 was advised as a way to mitigate BEAST attacks. However, due to the latest attacks on RC4, Microsoft has issued an advisory against it. The PCI DSS also prohibits the use of the RC4 bulk cipher.
https://www.acunetix.com/blog/articles/ ... hardening/

https://msrc-blog.microsoft.com/2013/11 ... sable-rc4/

I think I'll take the chance and try it.

Do you know of a place to verify the SSL/TLS cipher list specified in the GUI will match OpenSSL configuration?
I never said it was safe to use, but i suspect it is in there to be backward compatible with 5.6.7 (openssl 1.0.x)
The hmailserver usage goes beyond SorenR preferences... and what's the point disabling it if you do not allow it anyway?
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
mattg
Moderator
Moderator
Posts: 21527
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by mattg » 2021-05-30 04:42

RvdH wrote:
2021-05-29 20:16
I never said it was safe to use, but i suspect it is in there to be backward compatible with 5.6.7 (openssl 1.0.x)
The hmailserver usage goes beyond SorenR preferences... and what's the point disabling it if you do not allow it anyway?
I think that disabling weak ciphers stops TLS renegotiation to a lower level

In practice, no difference if you only accept TLSv1.2 or TLSv1.3

But some of the testing sites pull you up for allowing TLS renegotiation. If it is a certificate that you need for some auditors, then you need to do what it takes to get that certificate...
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
RvdH
Senior user
Senior user
Posts: 1506
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by RvdH » 2021-05-30 09:53

mattg wrote:
2021-05-30 04:42
RvdH wrote:
2021-05-29 20:16
I never said it was safe to use, but i suspect it is in there to be backward compatible with 5.6.7 (openssl 1.0.x)
The hmailserver usage goes beyond SorenR preferences... and what's the point disabling it if you do not allow it anyway?
I think that disabling weak ciphers stops TLS renegotiation to a lower level

In practice, no difference if you only accept TLSv1.2 or TLSv1.3

But some of the testing sites pull you up for allowing TLS renegotiation. If it is a certificate that you need for some auditors, then you need to do what it takes to get that certificate...
TLS renegotiation is completely removed from TLSv1.3 (as it was not secure) and in TLS 1.2 is entirely up to ciphers allowed (i believe), so maybe testing site that pull you up to allow TLS renegotiation are simply wrong/misinforming?

The point i tried making was, Soren is comparing TLS capabilities in 5.6.x against 5.7.x...and these 2 really are different beasts and it is not only 64-bit conversion as some other parts are entirely rewritten.
I can only guess, but i suspect the enable-weak-ssl-ciphers in OpenSSL build instructions is used to make 5.6.8 (openssl 1.1.x) backward compatible with the older 5.6.7 (openssl 1.0.x), as after all both are 5.6.x releases
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
RvdH
Senior user
Senior user
Posts: 1506
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by RvdH » 2021-05-30 10:07

Note the difference in TLS renegotiation (generated using sslscan)

Code: Select all

Testing SSL server mail.companyserver.com on port 993 using SNI name mail.companyserver.com (hMailServer 5.6.x)

  SSL/TLS Protocols:
SSLv2     disabled
SSLv3     disabled
TLSv1.0   enabled
TLSv1.1   enabled
TLSv1.2   enabled
TLSv1.3   enabled

  TLS Fallback SCSV:
Server supports TLS Fallback SCSV

  TLS renegotiation:
Secure session renegotiation supported

  TLS Compression:
Compression disabled

  Heartbleed:
TLSv1.3 not vulnerable to heartbleed
TLSv1.2 not vulnerable to heartbleed
TLSv1.1 not vulnerable to heartbleed
TLSv1.0 not vulnerable to heartbleed

  Supported Server Cipher(s):
Preferred TLSv1.3  256 bits  TLS_AES_256_GCM_SHA384        Curve P-256 DHE 256
Accepted  TLSv1.3  256 bits  TLS_CHACHA20_POLY1305_SHA256  Curve P-256 DHE 256
Accepted  TLSv1.3  128 bits  TLS_AES_128_GCM_SHA256        Curve P-256 DHE 256
Preferred TLSv1.2  256 bits  ECDHE-RSA-AES256-GCM-SHA384   Curve P-256 DHE 256
Accepted  TLSv1.2  256 bits  DHE-RSA-AES256-GCM-SHA384     DHE 2048 bits
Accepted  TLSv1.2  256 bits  ECDHE-RSA-CHACHA20-POLY1305   Curve P-256 DHE 256
Accepted  TLSv1.2  256 bits  DHE-RSA-CHACHA20-POLY1305     DHE 2048 bits
Accepted  TLSv1.2  256 bits  DHE-RSA-AES256-CCM8           DHE 2048 bits
Accepted  TLSv1.2  256 bits  DHE-RSA-AES256-CCM            DHE 2048 bits
Accepted  TLSv1.2  256 bits  ECDHE-ARIA256-GCM-SHA384      Curve P-256 DHE 256
Accepted  TLSv1.2  256 bits  DHE-RSA-ARIA256-GCM-SHA384    DHE 2048 bits
Accepted  TLSv1.2  128 bits  ECDHE-RSA-AES128-GCM-SHA256   Curve P-256 DHE 256
Accepted  TLSv1.2  128 bits  DHE-RSA-AES128-GCM-SHA256     DHE 2048 bits
Accepted  TLSv1.2  128 bits  DHE-RSA-AES128-CCM8           DHE 2048 bits
Accepted  TLSv1.2  128 bits  DHE-RSA-AES128-CCM            DHE 2048 bits
Accepted  TLSv1.2  128 bits  ECDHE-ARIA128-GCM-SHA256      Curve P-256 DHE 256
Accepted  TLSv1.2  128 bits  DHE-RSA-ARIA128-GCM-SHA256    DHE 2048 bits
Accepted  TLSv1.2  256 bits  ECDHE-RSA-AES256-SHA384       Curve P-256 DHE 256
Accepted  TLSv1.2  256 bits  DHE-RSA-AES256-SHA256         DHE 2048 bits
Accepted  TLSv1.2  256 bits  ECDHE-RSA-CAMELLIA256-SHA384  Curve P-256 DHE 256
Accepted  TLSv1.2  256 bits  DHE-RSA-CAMELLIA256-SHA256    DHE 2048 bits
Accepted  TLSv1.2  128 bits  ECDHE-RSA-AES128-SHA256       Curve P-256 DHE 256
Accepted  TLSv1.2  128 bits  DHE-RSA-AES128-SHA256         DHE 2048 bits
Accepted  TLSv1.2  128 bits  ECDHE-RSA-CAMELLIA128-SHA256  Curve P-256 DHE 256
Accepted  TLSv1.2  128 bits  DHE-RSA-CAMELLIA128-SHA256    DHE 2048 bits
Accepted  TLSv1.2  256 bits  ECDHE-RSA-AES256-SHA          Curve P-256 DHE 256
Accepted  TLSv1.2  128 bits  ECDHE-RSA-AES128-SHA          Curve P-256 DHE 256
Accepted  TLSv1.2  256 bits  AES256-GCM-SHA384
Accepted  TLSv1.2  256 bits  AES256-CCM8
Accepted  TLSv1.2  256 bits  AES256-CCM
Accepted  TLSv1.2  256 bits  ARIA256-GCM-SHA384
Accepted  TLSv1.2  128 bits  AES128-GCM-SHA256
Accepted  TLSv1.2  128 bits  AES128-CCM8
Accepted  TLSv1.2  128 bits  AES128-CCM
Accepted  TLSv1.2  128 bits  ARIA128-GCM-SHA256
Accepted  TLSv1.2  256 bits  AES256-SHA256
Accepted  TLSv1.2  256 bits  CAMELLIA256-SHA256
Accepted  TLSv1.2  128 bits  AES128-SHA256
Accepted  TLSv1.2  128 bits  CAMELLIA128-SHA256
Preferred TLSv1.1  256 bits  ECDHE-RSA-AES256-SHA          Curve P-256 DHE 256
Accepted  TLSv1.1  128 bits  ECDHE-RSA-AES128-SHA          Curve P-256 DHE 256
Preferred TLSv1.0  256 bits  ECDHE-RSA-AES256-SHA          Curve P-256 DHE 256
Accepted  TLSv1.0  128 bits  ECDHE-RSA-AES128-SHA          Curve P-256 DHE 256

Code: Select all

Testing SSL server mail.myprivateserver.com on port 993 using SNI name mail.myprivateserver.com (hMailServer 5.7.x)

  SSL/TLS Protocols:
SSLv2     disabled
SSLv3     disabled
TLSv1.0   disabled
TLSv1.1   disabled
TLSv1.2   enabled
TLSv1.3   enabled

  TLS Fallback SCSV:
Server supports TLS Fallback SCSV

  TLS renegotiation:
Session renegotiation not supported

  TLS Compression:
Compression disabled

  Heartbleed:
TLSv1.3 not vulnerable to heartbleed
TLSv1.2 not vulnerable to heartbleed

  Supported Server Cipher(s):
Preferred TLSv1.3  256 bits  TLS_AES_256_GCM_SHA384        Curve P-256 DHE 256
Accepted  TLSv1.3  256 bits  TLS_CHACHA20_POLY1305_SHA256  Curve P-256 DHE 256
Accepted  TLSv1.3  128 bits  TLS_AES_128_GCM_SHA256        Curve P-256 DHE 256
Preferred TLSv1.2  128 bits  ECDHE-RSA-AES128-GCM-SHA256   Curve P-256 DHE 256
Accepted  TLSv1.2  128 bits  DHE-RSA-AES128-GCM-SHA256     DHE 2048 bits
Accepted  TLSv1.2  256 bits  DHE-RSA-AES256-GCM-SHA384     DHE 2048 bits
Accepted  TLSv1.2  128 bits  ECDHE-RSA-AES128-SHA256       Curve P-256 DHE 256
Accepted  TLSv1.2  256 bits  ECDHE-RSA-AES256-SHA384       Curve P-256 DHE 256
Accepted  TLSv1.2  128 bits  DHE-RSA-AES128-SHA256         DHE 2048 bits
Accepted  TLSv1.2  256 bits  DHE-RSA-AES256-SHA256         DHE 2048 bits
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
SorenR
Senior user
Senior user
Posts: 4706
Joined: 2006-08-21 15:38
Location: Denmark

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-05-30 17:23

So... Fixed it...
167796637_792395504741541_8885185373493440196_n.png
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-05-30 23:37

Code: Select all

"ERROR"	3240	"2021-05-30 19:33:06.853"	"Severity: 3 (Medium), Code: HM5136, Source: TCPConnection::AsyncReadCompleted, Description: An error occured while parsing data. Data length: 47, Data: 6 UID FETCH 35858 BODY.PEEK[]<50105.4294967295>. Remote IP: 62.44.134.166"
One thing struck me, every single error is triggered by this "6 UID FETCH 35858 BODY.PEEK[]<50105.4294967295>" ... Where does "<50105.4294967295>" come from and are we sure "<start-index.length>" is within the boundaries of the email?

The email program on my Android send this when preview is defined:

Code: Select all

"IMAPD"	1100	990	"2021-05-30 23:31:33.060"	"192.168.0.158"	"RECEIVED: 9 UID FETCH 572928 (UID BODY.PEEK[2])"
My daughters iPhone send this when preview is defined:

Code: Select all

"IMAPD"	2668	213	"2021-05-29 09:19:13.141"	"62.44.138.175"	"RECEIVED: 6 UID FETCH 35850 BODY.PEEK[]<116644.4294967295>"
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

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

Been "playing" a bit with this problem.

I added script code to OnError() to see if I can capture something - anything - ;-)

Code: Select all

Sub OnError(iSeverity, iCode, sSource, sDescription)
    EventLog.Write( "" )
    EventLog.Write( "iSeverity: " & iSeverity )
    EventLog.Write( "iCode: " & iCode )
    EventLog.Write( "sSource: " & sSource )
    EventLog.Write( "sDescription: " & sDescription )

'    Exit Sub

    If sSource = "TCPConnection::AsyncReadCompleted" Then
        Dim iMessageUID, iOrigin, iLength

        Dim strRegEx, oMatch, oMatchCollection
        strRegEx = "^(?:.+UID FETCH )(.+)(?:BODY.PEEK\[\]<)(.+)(?:\.)(.+)(?:>.+)$"
        Set oMatchCollection = oLookup(strRegEx, sDescription, False)
        For Each oMatch In oMatchCollection
            If oMatch.SubMatches.Count > 0 Then
                iMessageUID = oMatch.SubMatches(0)
                iOrigin = oMatch.SubMatches(1)
                iLength = oMatch.SubMatches(2)
            End If
        Next
        Set oMatch = Nothing
        Set oMatchCollection = Nothing

        EventLog.Write( "iMessageUID      = " & iMessageUID )
        EventLog.Write( "iOrigin          = " & iOrigin )
        EventLog.Write( "iLength          = " & iLength )

        Dim a, strAccountAddress, strMessageFilename, strFile
        Dim oRecord, oDB : Set oDB = CreateObject("ADODB.Connection")
        oDB.Open "DRIVER={" & DBDRVR & "};Database=" & DBNAME & ";Uid=" & DBUID & ";Pwd=" & DBPW & ";FOUND_ROWS=1;"
        If oDB.State <> 1 Then
            EventLog.Write( "OnError - ERROR: Could not connect to database" )
            Exit Sub
        End If

        Set oRecord = oDB.Execute("SELECT hm_accounts.accountaddress, hm_messages.messagefilename, hm_messages.messageid FROM hm_messages " &_
                                  "INNER JOIN hm_accounts ON hm_accounts.accountid = hm_messages.messageaccountid " &_
                                  "WHERE hm_messages.messageuid = " & iMessageUID & ";")
        If Not oRecord.EOF then
            strAccountAddress = CStr(oRecord("accountaddress"))
            strMessageFilename = CStr(oRecord("messagefilename"))

            EventLog.Write( "accountaddress   = " & strAccountAddress )
            EventLog.Write( "messagefilename  = " & strMessageFilename )

            a = Split(strAccountAddress, "@")
            If (a(1) <> "") Then
                strFile = "C:\hMailServer\Data\" & a(1) & "\" & a(0) & "\" & Mid(strMessageFilename, 2, 2) & "\" & strMessageFilename

                EventLog.Write( "strFile          = " & strFile )

' *** Next section is untested ***
'
'                Dim f, strEmail, strPreview
'                With CreateObject("Scripting.FileSystemObject")
'                    Set f = .OpenTextFile(strFile, 1)
'                    strEmail = f.ReadAll
'                    strPreview = Mid(strEmail, iOrigin, iLength)
'
'                    EventLog.Write( "Len(strPreview)  = " & Len(strPreview) )
'
'                    Set f = Nothing
'                End With

            End If
        End If

        oRecord.Close
        oDB.Close
        Set oRecord = Nothing
        Set oDB = Nothing

    End If
End Sub
This code will produce this output:

Code: Select all

2428		"2021-06-01 12:31:05.878"	"iSeverity: 3"
2428		"2021-06-01 12:31:05.878"	"iCode: 5136"
2428		"2021-06-01 12:31:05.878"	"sSource: TCPConnection::AsyncReadCompleted"
2428		"2021-06-01 12:31:05.890"	"sDescription: An error occured while parsing data. Data length: 49, Data: 43 UID FETCH 35883 BODY.PEEK[]<137504.4294967295>. Remote IP: 62.44.135.127"
2428		"2021-06-01 12:31:05.890"	"iMessageUID     = 35883"
2428		"2021-06-01 12:31:05.890"	"iOrigin         = 137504"
2428		"2021-06-01 12:31:05.890"	"iLength         = 4294967295"
2428		"2021-06-01 12:31:05.925"	"accountaddress  = Wile.E.Coyote@acme.inc"
2428		"2021-06-01 12:31:05.925"	"messagefilename = {9D9C14A2-7C70-4C08-9AB5-02E9ADD9B725}.eml"
2428		"2021-06-01 12:31:05.925"	"strFile         = C:\hMailServer\Data\acme.inc\Wile.E.Coyote\9D\{9D9C14A2-7C70-4C08-9AB5-02E9ADD9B725}.eml"
From what I have read (RFC's etc.) then "iOrigin" is the starting point - in bytes - of the email data and "iLength" is the data chunk - in bytes - used for preview.

The "untested code" in the script is supposed to read the .EML file as ANSI text (default) thus I can assume 1 byte = 1 character and that means I can use the numbers (iOrigin, iLength) directly in the MID() directive.

The aim is to see if hMailServer is reading beyond the bounderies of the .EML file and thus casting the error. In theory if Len(strPreview) <> iLength.

Long shot - yes but I need to try it ;-)
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-06-01 18:33

Hmm...

This

Code: Select all

strPreview = Mid(strEmail, iOrigin, iLength)
results in this

Code: Select all

"ERROR"	2608	"2021-06-01 17:09:07.253"	"Script Error: Source: Microsoft VBScript runtime error - Error: 800A0006 - Description: Overflow: 'iLength' - Line: 2299 Column: 20 - Code: (null)"

Code: Select all

2608		"2021-06-01 17:09:07.222"	"iSeverity: 3"
2608		"2021-06-01 17:09:07.222"	"iCode: 5136"
2608		"2021-06-01 17:09:07.222"	"sSource: TCPConnection::AsyncReadCompleted"
2608		"2021-06-01 17:09:07.222"	"sDescription: An error occured while parsing data. Data length: 47, Data: 6 UID FETCH 35887 BODY.PEEK[]<53143.4294967295>. Remote IP: 212.97.248.108"
2608		"2021-06-01 17:09:07.222"	"iMessageUID      = 35887"
2608		"2021-06-01 17:09:07.222"	"iOrigin          = 53143"
2608		"2021-06-01 17:09:07.222"	"iLength          = 4294967295"
2608		"2021-06-01 17:09:07.253"	"accountaddress   = xxxxxx@yyyyyy.zzz"
2608		"2021-06-01 17:09:07.253"	"messagefilename  = {FAD374C9-63BD-43ED-90E3-20B97D59AABE}.eml"
2608		"2021-06-01 17:09:07.253"	"strFile          = C:\hMailServer\Data\yyyyy.zzz\xxxxxx\FA\{FAD374C9-63BD-43ED-90E3-20B97D59AABE}.eml"
Seems "iLength" should be LongLong but vbScript only know about Long ... (-2147483648 to 2147483647)
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

Besserwisser
New user
New user
Posts: 10
Joined: 2019-06-29 22:53
Location: Germany

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by Besserwisser » 2021-06-03 21:34

I get the same error message in my log files when I move messages between folders multiple times with my iPad (iPadOS 14.6, built-in mail app). After several movements, the iPad is not completely synchronized with the hmailserver and I get a mini dump in the log directory. It also happens sometimes when messages are deleted with the iPad. I use hMailServer 5.6.8 - Build 2538.
Version 5.6.8 - Build 2538, MariaDB 10.3 on Windows Server 2019

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-06-12 10:48

Code: Select all

"IMAPD"	2296	171	"2021-06-12 09:01:56.904"	"192.168.0.150"	"RECEIVED: 6 UID FETCH 35994 BODY.PEEK[]"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc1: iSize              33851"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc1: oPart.octet_start_ -1"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc1: oPart.octet_count_ -1"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc1: iByteStart         0"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc1: iByteCount         0"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc2: iSize              33851"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc2: oPart.octet_start_ -1"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc2: oPart.octet_count_ -1"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc2: iByteStart         0"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc2: iByteCount         33851"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc3: iSize              33851"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc3: oPart.octet_start_ -1"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc3: oPart.octet_count_ -1"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc3: iByteStart         0"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc3: iByteCount         33851"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc4: iSize              33851"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc4: oPart.octet_start_ -1"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc4: oPart.octet_count_ -1"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc4: iByteStart         0"
"APPLICATION"	2296	"2021-06-12 09:01:56.919"	"TEST TRACE IIc4: iByteCount         33851"
"IMAPD"	2296	171	"2021-06-12 09:01:56.919"	"192.168.0.150"	"SENT: * 4 FETCH (UID 35994 BODY[] {33851}"
"IMAPD"	2296	171	"2021-06-12 09:01:56.919"	"192.168.0.150"	"SENT: )"
"IMAPD"	2296	171	"2021-06-12 09:01:56.919"	"192.168.0.150"	"SENT: 6 OK UID completed"
"IMAPD"	3348	171	"2021-06-12 09:01:57.060"	"192.168.0.150"	"RECEIVED: 7 UID FETCH 35994 BODY.PEEK[]<33851.4294967295>"
"APPLICATION"	3348	"2021-06-12 09:01:57.060"	"TEST TRACE IIc1: iSize              33851"
"APPLICATION"	3348	"2021-06-12 09:01:57.060"	"TEST TRACE IIc1: oPart.octet_start_ 33851"
"APPLICATION"	3348	"2021-06-12 09:01:57.060"	"TEST TRACE IIc1: oPart.octet_count_ 2147483647"
"APPLICATION"	3348	"2021-06-12 09:01:57.060"	"TEST TRACE IIc1: iByteStart         0"
"APPLICATION"	3348	"2021-06-12 09:01:57.060"	"TEST TRACE IIc1: iByteCount         0"
"APPLICATION"	3348	"2021-06-12 09:01:57.060"	"TEST TRACE IIc2: iSize              33851"
"APPLICATION"	3348	"2021-06-12 09:01:57.060"	"TEST TRACE IIc2: oPart.octet_start_ 33851"
"APPLICATION"	3348	"2021-06-12 09:01:57.060"	"TEST TRACE IIc2: oPart.octet_count_ 2147483647"
"APPLICATION"	3348	"2021-06-12 09:01:57.060"	"TEST TRACE IIc2: iByteStart         33851"
"APPLICATION"	3348	"2021-06-12 09:01:57.060"	"TEST TRACE IIc2: iByteCount         0"
"ERROR"	3348	"2021-06-12 09:01:57.060"	"Severity: 3 (Medium), Code: HM5136, Source: TCPConnection::AsyncReadCompleted, Description: An error occured while parsing data. Data length: 47, Data: 7 UID FETCH 35994 BODY.PEEK[]<33851.4294967295>. Remote IP: 192.168.0.150"
"ERROR"	3348	"2021-06-12 09:01:57.075"	"Severity: 2 (High), Code: HM4208, Source: ExceptionHandler::Run, Description: An error occured while executing 'IOCPQueueWorkerTask'"
"ERROR"	3348	"2021-06-12 09:01:57.154"	"Severity: 1 (Critical), Code: HM5519, Source: StackLogger::Log, Description: An error has been detected. A mini dump has been written to C:\hMailServer\Logs\minidump_2021-06-12 090157_{EB650E73-6EC3-4229-A072-EEE8308ACA24}.dmp"

Code: Select all

      else if (oPart.GetShowBodyFull())
      {
         /*
         BODY[]
         An empty section specification refers to the entire message, 
         including the header.

         RFC822 is
         Functionally equivalent to BODY[], differing in the syntax of
         the resulting untagged FETCH data (RFC822 is returned).
         */

         int iSize = FileUtilities::FileSize(messageFileName);

         LOG_APPLICATION("TEST TRACE IIc1: iSize              " + StringParser::IntToString(iSize));
         LOG_APPLICATION("TEST TRACE IIc1: oPart.octet_start_ " + StringParser::IntToString(oPart.octet_start_));
         LOG_APPLICATION("TEST TRACE IIc1: oPart.octet_count_ " + StringParser::IntToString(oPart.octet_count_));
         LOG_APPLICATION("TEST TRACE IIc1: iByteStart         " + StringParser::IntToString(iByteStart));
         LOG_APPLICATION("TEST TRACE IIc1: iByteCount         " + StringParser::IntToString(iByteCount));

         GetBytesToSend_(iSize, oPart, iByteStart, iByteCount);

         LOG_APPLICATION("TEST TRACE IIc2: iSize              " + StringParser::IntToString(iSize));
         LOG_APPLICATION("TEST TRACE IIc2: oPart.octet_start_ " + StringParser::IntToString(oPart.octet_start_));
         LOG_APPLICATION("TEST TRACE IIc2: oPart.octet_count_ " + StringParser::IntToString(oPart.octet_count_));
         LOG_APPLICATION("TEST TRACE IIc2: iByteStart         " + StringParser::IntToString(iByteStart));
         LOG_APPLICATION("TEST TRACE IIc2: iByteCount         " + StringParser::IntToString(iByteCount));

         BYTE *pBuf = new BYTE[iByteCount];
         FileUtilities::ReadFileToBuf(messageFileName, pBuf, iByteStart, iByteCount);

         LOG_APPLICATION("TEST TRACE IIc3: iSize              " + StringParser::IntToString(iSize));
         LOG_APPLICATION("TEST TRACE IIc3: oPart.octet_start_ " + StringParser::IntToString(oPart.octet_start_));
         LOG_APPLICATION("TEST TRACE IIc3: oPart.octet_count_ " + StringParser::IntToString(oPart.octet_count_));
         LOG_APPLICATION("TEST TRACE IIc3: iByteStart         " + StringParser::IntToString(iByteStart));
         LOG_APPLICATION("TEST TRACE IIc3: iByteCount         " + StringParser::IntToString(iByteCount));

         pOutBuf->Add(pBuf, iByteCount);
         delete [] pBuf;

         LOG_APPLICATION("TEST TRACE IIc4: iSize              " + StringParser::IntToString(iSize));
         LOG_APPLICATION("TEST TRACE IIc4: oPart.octet_start_ " + StringParser::IntToString(oPart.octet_start_));
         LOG_APPLICATION("TEST TRACE IIc4: oPart.octet_count_ " + StringParser::IntToString(oPart.octet_count_));
         LOG_APPLICATION("TEST TRACE IIc4: iByteStart         " + StringParser::IntToString(iByteStart));
         LOG_APPLICATION("TEST TRACE IIc4: iByteCount         " + StringParser::IntToString(iByteCount));

      }
Seems the problem lies in these lines...

https://github.com/hmailserver/hmailser ... #L422-L423

I have tried to mend it by assigning -1 to oPart.octet_start_ and oPart.octet_count_ but for some reason I end up with hMailServer running out of memory and greating different minidump ... :roll: ... or the Apple mail client suddenly send 100,000 repeats with rising values :evil:

There is something here I have not quite figured out how it works... :oops:
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-06-12 11:05

It appears that Martin have tried to fix this in the past...

https://github.com/hmailserver/hmailser ... #L402-L405

Well, it's not working as it is in the wrong place ...
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-06-15 09:32

Hmm...

The minidump seem to originate from "memcpy()"

https://github.com/hmailserver/hmailser ... #L256-L270

"memcpy" is a "C" command and as such it cannot "throw an exception", it just fails :roll:

"Trace:"

Code: Select all

IMAPFetch.cpp     L422: BYTE *pBuf = new BYTE[iByteCount];"
IMAPFetch.cpp     L423: FileUtilities::ReadFileToBuf(messageFileName, pBuf, iByteStart, iByteCount);"
FileUtilities.cpp L258: File file;"
FileUtilities.cpp L259: if (!file.Open(sFilename, File::OTReadOnly))"
FileUtilities.cpp L264: file.SetPosition(iStart);"
FileUtilities.cpp L266: std::shared_ptr<ByteBuffer> bytes = file.ReadChunk(iCount);"
FileUtilities.cpp L268: memcpy(OutBuf, bytes->GetBuffer(), iCount);"               <==== HERE !!
IMAPFetch.cpp     L424: pOutBuf->Add(pBuf, iByteCount);"
IMAPFetch.cpp     L425: delete[] pBuf;"
@RvdH Do you have any ideas?
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-06-15 11:10

Mmmm.... I _think_ I just need to figure out how to use this - if possible...

Code: Select all

size_t getCopySize(size_t sourceSize, size_t destSize)
{
    return (destSize <= sourceSize ? destSize : sourceSize);
}
memcpy(destination, source, getCopySize(sizeof(source),sizeof(destination)));
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by RvdH » 2021-06-16 10:33

SorenR wrote:
2021-06-15 09:32
@RvdH Do you have any ideas?
Nope sorry... and can't really say i have seen this behavior before and I know for sure a client of ours uses the iCrap stuff ;)
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
SorenR
Senior user
Senior user
Posts: 4706
Joined: 2006-08-21 15:38
Location: Denmark

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-06-16 11:22

RvdH wrote:
2021-06-16 10:33
SorenR wrote:
2021-06-15 09:32
@RvdH Do you have any ideas?
Nope sorry... and can't really say i have seen this behavior before and I know for sure a client of ours uses the iCrap stuff ;)
I Had my hands on my daughters phone (iPhone 12 PRO IOS 14.6) yesterday, deleted the mail account and created it again. No issues since.

However my logs show plenty incidents since 1/6 ... Nothing before 1/6 so I'm guessing something got updated on the phone over night.

I also found this: https://www.mailenable.com/kb/content/a ... D=ME020712

So... It's not a new problem.
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by jimimaseye » 2021-06-16 11:57

This simply can't be true.

Remember, Apple is faultless - didn't you know?

:roll:

[Entered by mobile. Excuse my spelling.]
5.7 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: 4706
Joined: 2006-08-21 15:38
Location: Denmark

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-06-16 12:10

jimimaseye wrote:
2021-06-16 11:57
This simply can't be true.

Remember, Apple is faultless - didn't you know?

:roll:

[Entered by mobile. Excuse my spelling.]
She also have Outlook installed on the phone but I could not make it connect to my server on neither TLS or SSL for some reason. Works fine with GMail and Exchange. I just had a problem specifying SSL on port 993/465. Also tried (Optional TLS) on port 143/587. No dice.

What puzzles me is there were NO field in the Outlook (advanced) config to specify SSL/TLS.

It was wife's birthday the other day - gave her a new Huawei Nova 5T phone - it works - always :mrgreen:
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by RvdH » 2021-06-16 12:37

Is that "X-Apple-Content-Length" header that is talked about on mailenable website present?
What if you would strip that header?

Code: Select all

	If oMessage.HeaderValue("X-Apple-Content-Length")<>"" Then
		oMessage.Headers.ItemByName("X-Apple-Content-Length").Delete
		oMessage.Save
	End If
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

tunis
Senior user
Senior user
Posts: 288
Joined: 2015-01-05 20:22
Location: Sweden

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by tunis » 2021-06-16 16:13

SorenR wrote:
2021-06-16 12:10
She also have Outlook installed on the phone but I could not make it connect to my server on neither TLS or SSL for some reason. Works fine with GMail and Exchange. I just had a problem specifying SSL on port 993/465. Also tried (Optional TLS) on port 143/587. No dice.
I have also error that outlook-app could not connect, but with exchange.
It was that I blocked all country's but Sweden and outlook-app after an update is connecting throw microsoft-server to get mail from our exchange. So when I removed Geo blocking outlook was working again.
HMS 5.6.8 B2534.28 on Windows Server 2019 Core VM.
HMS 5.6.8 B2538.30 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: 4706
Joined: 2006-08-21 15:38
Location: Denmark

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-06-16 17:26

tunis wrote:
2021-06-16 16:13
SorenR wrote:
2021-06-16 12:10
She also have Outlook installed on the phone but I could not make it connect to my server on neither TLS or SSL for some reason. Works fine with GMail and Exchange. I just had a problem specifying SSL on port 993/465. Also tried (Optional TLS) on port 143/587. No dice.
I have also error that outlook-app could not connect, but with exchange.
It was that I blocked all country's but Sweden and outlook-app after an update is connecting throw microsoft-server to get mail from our exchange. So when I removed Geo blocking outlook was working again.
She will have to do without Outlook then :mrgreen:
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by SorenR » 2021-06-16 17:27

RvdH wrote:
2021-06-16 12:37
Is that "X-Apple-Content-Length" header that is talked about on mailenable website present?
What if you would strip that header?

Code: Select all

	If oMessage.HeaderValue("X-Apple-Content-Length")<>"" Then
		oMessage.Headers.ItemByName("X-Apple-Content-Length").Delete
		oMessage.Save
	End If
I checked, not present in any of the emails triggering the minidump...

I fixed OnError() to log events so I could take a look at the email file...

Code: Select all

2888		"2021-06-15 08:15:35.595"	"iSeverity: 3"
2888		"2021-06-15 08:15:35.595"	"iCode: 5136"
2888		"2021-06-15 08:15:35.595"	"sSource: TCPConnection::AsyncReadCompleted"
2888		"2021-06-15 08:15:35.595"	"sDescription: An error occured while parsing data. Data length: 47, Data: 6 UID FETCH 36027 BODY.PEEK[]<68044.4294967295>. Remote IP: 62.44.135.137"
2888		"2021-06-15 08:15:35.595"	"iMessageUID      = 36027"
2888		"2021-06-15 08:15:35.595"	"iOrigin (octet)  = 68044"
2888		"2021-06-15 08:15:35.595"	"iLength (octet)  = 4294967295"
2888		"2021-06-15 08:15:35.673"	"accountaddress   = wile.e.coyote@acme.inc"
2888		"2021-06-15 08:15:35.673"	"messagefilename  = {C52EB908-48EE-43A0-AB3B-8D5EE9AA90D2}.eml"
2888		"2021-06-15 08:15:35.673"	"strFile          = C:\hMailServer\Data\acme.inc\wile.e.coyote\C5\{C52EB908-48EE-43A0-AB3B-8D5EE9AA90D2}.eml"
2888		"2021-06-15 08:15:35.689"	"C:\hMailServer\Data\acme.inc\wile.e.coyote\C5\{C52EB908-48EE-43A0-AB3B-8D5EE9AA90D2}.eml = 68044 bytes"
2888		"2021-06-15 08:15:35.689"	""
2888		"2021-06-15 08:15:35.689"	"iSeverity: 2"
2888		"2021-06-15 08:15:35.689"	"iCode: 4208"
2888		"2021-06-15 08:15:35.689"	"sSource: ExceptionHandler::Run"
2888		"2021-06-15 08:15:35.689"	"sDescription: An error occured while executing 'IOCPQueueWorkerTask'"
2888		"2021-06-15 08:15:35.783"	""
2888		"2021-06-15 08:15:35.783"	"iSeverity: 1"
2888		"2021-06-15 08:15:35.783"	"iCode: 5519"
2888		"2021-06-15 08:15:35.783"	"sSource: StackLogger::Log"
2888		"2021-06-15 08:15:35.783"	"sDescription: An error has been detected. A mini dump has been written to C:\hMailServer\Logs\minidump_2021-06-15 081535_{11EA8E0A-C40B-40A2-B31D-648DC019A0C2}.dmp"
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: Weird error cause minidumps with 5.6.8-B2555.Custom

Post by katip » 2021-06-16 18:55

SorenR wrote:
2021-06-16 17:27
I checked, not present in any of the emails triggering the minidump...
in fact, i scanned my archive of last 5 years and couldn't find a single mail with that header among hunderds of iPhone originated mails.
Google doesn't give something useful either except its existance. i wonder where Mailenable invents this.
Katip
--
HMS 5.7.0, MariaDB 10.4.10, SA 3.4.2, ClamAV 0.103.2

Post Reply