Loads of "timeout" errors from importMail 2.0 in CS-log after upgrade to 8.4

Hi,

We've recently upgraded CS from 7.5 to 8.4.

Almost immediately after the upgrade, when we started the scheduler, the CS-log began logging a lot of "timeout" events from importMail 2.0.

A few examples:

[02216] [(System) ] [importMail.e] 2018-12-19 23:12:53.131 [62.329] [0.000]: importMail 2.0: GeneralException (HttpConnection::doCurlCommand: Timeout was reached. Operation timed out after 60000 milliseconds with 112027040730841088 bytes received) in :-1
[03472] [(System) ] [importMail.e] 2018-12-19 23:14:53.116 [62.276] [0.000]: importMail 2.0: GeneralException (HttpConnection::doCurlCommand: Timeout was reached. Operation timed out after 60062 milliseconds with 111182615800709120 bytes received) in :-1
[03516] [(System) ] [importMail.e] 2018-12-19 23:16:53.151 [62.309] [0.000]: importMail 2.0: GeneralException (HttpConnection::doCurlCommand: Timeout was reached. Operation timed out after 60031 milliseconds with 112397696408485888 bytes received) in :-1
[01344] [(System) ] [importMail.e] 2018-12-19 23:18:53.130 [62.283] [0.000]: importMail 2.0: GeneralException (HttpConnection::doCurlCommand: Timeout was reached. Operation timed out after 60047 milliseconds with 112449253195907072 bytes received) in :-1
[03400] [(System) ] [importMail.e] 2018-12-19 23:18:54.259 [3.420] [3.420]: importMail 2.0: GeneralException (HttpConnection::doCurlCommand: Failure when receiving data from the peer. €) in :-1
[03400] [(System) ] [importMail.e] 2018-12-19 23:18:54.587 [3.744] [0.324]: importMail 2.0: GeneralException (HttpConnection::doCurlCommand: Failure when receiving data from the peer. ) in :-1
[03400] [(System) ] [importMail.e] 2018-12-19 23:18:54.931 [4.087] [0.343]: importMail 2.0: GeneralException (HttpConnection::doCurlCommand: Failure when receiving data from the peer. ) in :-1

 

I also tried debugging the importMail.exe and received this message from all mailboxes in CS.

 

From the look of things, CS is struggling with deleting emails in the mailbox after importing, but thankfully every email seems to be imported into CS just fine.

We recently used POP on the mailboxes, but switched to IMAPS while troubleshooting this issue.

Unfortunately, this did not seem to resolve it.

 

I have tried searching the Community here for a solution, but could not find one.

Can you assist?

Thanks!

 

-Markus

RE: Loads of "timeout" errors from importMail 2.0 in CS-log after upgrade to 8.4

Hi, it might be that when uppgrading to 8.2 or greater SOinstaller change from Easymail to Mailkit.

1. look in web.config of netserver used for service.

 

https://community.superoffice.com/en/technical/documentation/administration/config-ini/mailkit/

 

2.  you may also need to lok into the crm8.registry-table and specific on reg_id = 320 change from 0 to 2 (0 new mailkit 2 old easymail)

/Anders

Av: Anders Larsson 21. dec 2018

RE: Loads of "timeout" errors from importMail 2.0 in CS-log after upgrade to 8.4

We have seen that large emails can take more time than 1 minute to import. Therefor, in the next release (8.4 R05) we have increased the timeout when receiving data from the email server (now defaults to 5 minutes). In that version, it is also possible to increase or decrease the timeout value.

Av: Stian Andre Olsen 2. jan 2019

RE: Loads of "timeout" errors from importMail 2.0 in CS-log after upgrade to 8.4

@Anders

The change in registry-table did the trick! (Back to Easymail from Mailkit)
It is still set to "Mailkit" in the web.config, but since it works, we'll leave it as is, for now.

Thanks!

PS. Any idea why it is behaving like this with Mailkit?

 

@Wilhelm

So this value is set to "2" in the table and you are still having issues?
In my case, I did not have to change the values in web.config - have you tried to only change the table and leave the web.config as is?

Av: Markus Moripen 8. jan 2019

RE: Loads of "timeout" errors from importMail 2.0 in CS-log after upgrade to 8.4

Hi, Yes I have seen that only changing in registry-table solved issues with SMTP authentication for mailings.

So not sure where setting in regitry-table vs setting in web.config is used within the application.
Maybe someone at RND can give an explanation? 

Good that the change solved your issues!!

Mailkit is an open soucre library for send mail etc from with in .net code.

SuperOffice RND did the change in 8.2 i belive it was and that caused some issues with mailings SMTP connections etc and fetching emails. (it works towards newer Exchange systems including Office 365 Exchange online) Older instances of Exchange are having issues. So my advice here would be to check and update Exchange environment with SP and or new version. (I belive it has something to to with authentiaction / TLS etc)

/Best regards
Anders

Av: Anders Larsson 9. jan 2019

RE: Loads of "timeout" errors from importMail 2.0 in CS-log after upgrade to 8.4

Just to clarify a bit:

Service has it's own email client implementation, which is used for importing mail (POP and IMAP) and for sending mail (SMTP). This implementation is done using the cURL library. 

However, it is possible to switch Service to use th email client implementation in NetServer. This is done by setting the value in the Registry table with reg_id=320 to the value "2" (at least for later versions of SuperOffice, like 8.4). 
NetServer uses an implementation called "MailKit". This was (as said here) changed from EasyMail at some point. 
The EasyMail library is not maintained anymore, and it has numerous problems with different servers (and especially certificates).

Some notes:
The cURL implementation is rather picky on the SSL certificates. It does for example not accept self signed certificates, and it is importaint that one connects to the hostname that the certificates is valid for (so if it is created for a specific domain name, then you cannot use the IP address and connect to that). 
Also note that STARTTLS is attempted automatically if the server supports that. This means if you try to connect to an unsecure connection, it will automatically be upgraded to a secure connection. It is possible to turn of this behaviour using the Registry.

We have seen situations where cURL is not able to import an email in 60 seconds, and therefor fails. In the latest version, this timeout has been increased to 5 minutes (actually, this is controlled by a Registry value, but the default value there is 5 minutes). 

Av: Stian Andre Olsen 10. jan 2019

RE: Loads of "timeout" errors from importMail 2.0 in CS-log after upgrade to 8.4

Hello Stian,

My understanding was that setting reg_id 320 to value '2' it means that service will use the 'old implementation'?

Your explanation that Service will use the MailKit implementation of NetServer doesn't correspond with the issues we have had at customers with self signed certificates for an internal smtp server (version 8.4). The only way to get Service working at these customers is to set reg_id 320 to 2, but then the integrated mailbox still won't work (because of certficates issue).

If this has changed recently it would be great to know, and a way to disable these certificates check would be awesome. (I understand that it has security implications, but if it is an internal stmp server the risk is minimal)

Av: David Hollegien 10. jan 2019

RE: Loads of "timeout" errors from importMail 2.0 in CS-log after upgrade to 8.4

Let me be presise:

reg_id: 320

value != 2:
Service (CS) will use the cURL implementation (implemented in CS)

value == 2:
If you have configured the SMTP settings in Service with SSL or you have configured a username/password, then it will use NetServers implementation. If this is MailKit or EasyMail is determined by the configuration of NetServer. But using EasyMail isn't really supported.
If you have not SSL and not a username, then the old implementation for CS is used.

The integrated mailbox (if you are talking about the Web Inbox) is using NetServer now matter the setting above.

Av: Stian Andre Olsen 23. jan 2019

RE: Loads of "timeout" errors from importMail 2.0 in CS-log after upgrade to 8.4

It was fixed in 8.4 R04, bug id: 61659

Av: Stian Andre Olsen 31. jan 2019

RE: Loads of "timeout" errors from importMail 2.0 in CS-log after upgrade to 8.4

Pretty sure it is R04 (if this was released for Onsite).

But in the debug, does it says timeout after 60000 milliseconds?

And in the Registry table, what is the value of reg_id=321?

Av: Stian Andre Olsen 1. feb 2019