Skip to main content

I have 2 tenants in our Acumatica install (single server). Test and Live. On our Test tenant I was able to get a System Email account added, setup and working perfect. However on our Live tenant, after mirroring the settings exactly like the account on the Test tenant, after clicking the [test] button, it just spins, and the Elapsed Time just keeps counting.

I've triple checked the system email account settings, everything matches.

Some notes:

The spinner "Press to abort", does nothing.

System Management -> System Monitor does show the running process. However the ABORT button does nothing. Also, if I click [Active Threads], it shows this error in the modal that pops up:
 

User: xxx
Screen: ~/pages/sm/sm204002.aspx
Command: checkEMailAccount
Time, sec: 750
at System.Net.UnsafeNclNativeMethods.OSSOCK.recv(IntPtr socketHandle, Byte* pinnedBuffer, Int32 len, SocketFlags socketFlags)
at System.Net.UnsafeNclNativeMethods.OSSOCK.recv(IntPtr socketHandle, Byte* pinnedBuffer, Int32 len, SocketFlags socketFlags)
at System.Net.Sockets.Socket.Receive(Bytee] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError& errorCode)
at System.Net.Sockets.NetworkStream.Read(Bytee] buffer, Int32 offset, Int32 size)
at PX.Common.IO.SmartStream.a(Boolean A_0, BufferCallback A_1) in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 64230
at PX.Common.IO.SmartStream.ReadLine(ReadLineAsyncOP op, Boolean async) in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 63092
at PX.Common.IMAP.Client.ImapClient.OnConnected() in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 101114
at PX.Common.TCP.TcpClient.OnConnected(CompleteConnectCallback callback) in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 66629
at PX.Common.TCP.TcpClient.ConnectAsyncOP.c() in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 65490
at PX.Common.TCP.TcpClient.ConnectAsyncOP.Start(TcpClient owner) in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 65295
at PX.Common.TCP.TcpClient.ConnectAsync(ConnectAsyncOP op) in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 66345
at PX.Common.TCP.TcpClient.Connect(IPEndPoint localEP, IPEndPoint remoteEP, Boolean ssl, RemoteCertificateValidationCallback certCallback) in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 66285
at PX.Common.TCP.TcpClient.Connect(IPEndPoint localEP, IPEndPoint remoteEP, Boolean ssl) in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 66239
at PX.Common.TCP.TcpClient.Connect(String host, Int32 port, Boolean ssl) in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 66189
at PX.Common.Mail.MailReceiver.ImapReceiver.a() in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 120511
at PX.Common.Mail.MailReceiver.ImapReceiver.Test() in C:\Users\svc-builder\AppData\Local\Temp\~PX.Comm.0\PX.Common.dll.il:line 120502
at PX.SM.EMailAccountMaint.a(Action A_0, String A_1) in C:\Bld2\AC-FULL2019R19-JOB1\Sources\NetTools\PX.Data\Maintenance\SM\EMailAccountMaint.cs:line 295
at PX.SM.EMailAccountMaint.b(IEnumerable`1 A_0) in C:\Bld2\AC-FULL2019R19-JOB1\Sources\NetTools\PX.Data\Maintenance\SM\EMailAccountMaint.cs:line 113
at PX.Data.PXLongOperation.<>c__DisplayClass17_0.b__0() in C:\Bld2\AC-FULL2019R19-JOB1\Sources\NetTools\PX.Data\Process\Operation.cs:line 1246
at PX.Data.PXLongOperation.d(Object A_0) in C:\Bld2\AC-FULL2019R19-JOB1\Sources\NetTools\PX.Data\Process\Operation.cs:line 1482
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at PX.Data.PXThreadPool.a() in C:\Bld2\AC-FULL2019R19-JOB1\Sources\NetTools\PX.Data\Process\Threadpool.cs:line 139
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Eventually after 30 minutes or so, the process just goes away.

Any suggestions as to what may be different between the two tenants, and/or what would cause this behavior?

 

In the test tenant, make sure the Automation Schedule for send and receive emails is not active. As you wouldn't want emails from your test system going out.  Possibly check how often both are sending and receiving.   I have setup in mult production tenants without issue. 360/Google.  You have to add to Server and Advanced. Enter user and password.  Sorry hope this helps. Matt


What SMTP service are you using? Do you have access to it to check connection logs?


Looks like something is holding the connection. It could be connection pool starving on the web host. The connection is stuck on IMAP receiving state which means SMTP send was already processed with no error.

https://answers.dynatrace.com/questions/101147/io-in-systemnetunsafenclnativemethodsossock-recv-m.html#


What service provider are you using? Is the email address set up for MFA? Can you show a screenshot of your current settings?
Here are my settings for O365, seems to work every time.
 

 

Below are the settings on the Advanced tab.

 


Hope this helps :)


What SMTP service are you using? Do you have access to it to check connection logs?

Yes, SMTP IN is showing DC’ed by the client. Almost instantly after the connection is made.


Looks like something is holding the connection. It could be connection pool starving on the web host. The connection is stuck on IMAP receiving state which means SMTP send was already processed with no error.

https://answers.dynatrace.com/questions/101147/io-in-systemnetunsafenclnativemethodsossock-recv-m.html#

 

Same single server/IIS application (web.config), one tenant works, second tenant does not. Same settings everywhere. One tenant works with multiple system email accounts, second tenant does not work, same accounts.


Looks like something is holding the connection. It could be connection pool starving on the web host. The connection is stuck on IMAP receiving state which means SMTP send was already processed with no error.

https://answers.dynatrace.com/questions/101147/io-in-systemnetunsafenclnativemethodsossock-recv-m.html#

 

That thread is unrelated.

I’ve tried POP3 and IMAP, same behavior. I’ve rebooted the server several times.

We have a total 3 users, not all using it at the same time. The other tenant (on the same install) works fine.


Here are the screens from the working tenant:

 

And here are the them from the not working tenant, again same server, same install, same credentials:

 


What build are you running in Acumatica?  I always thought your email and mail domain had to match.  I see you are with GoDaddy is your domain provider.  Maybe this site can help isolate your problem.

   https://mxtoolbox.com/domain/fusionimaging.com/?source=findmonitors


What build are you running in Acumatica?  I always thought your email and mail domain had to match.  I see you are with GoDaddy is your domain provider.  Maybe this site can help isolate your problem.

   https://mxtoolbox.com/domain/fusionimaging.com/?source=findmonitors

 

No I’m hosting my own email server, its sitting in the next room. Those are good suggestions, but like I said, the other tenant setup exactly the same as the culprit, work’s flawlessly. Our email server is hosting both domains, however I just added the dash “-” just to make sure that was not the cause, same behavior.

 

Acumatica 2019 R1
Build 19.104.0024


What is the hung connection state according to the mail server logs? What are the latest messages?

Have you tried any other email provider just for the testing purpose?

What happens if switch to POP?

 


@ilyababentsov24 

The server logs show the client immediately disconnects after connection.

I will try my gmail account.

I have tried POP3, same behavior.

Again everything works flawlessly on the other tenant, what could cause this between tenants?


TEST Email account consists of 2 parts test SMTP and test IMAP/POP. Which disconnect is seend in logs IMAP or SMTP? The trace in the original messae of topic shows the thread is in IMAP connection state. and IMAP test goes after SMTP went successful.

Tenants have the same runtime and execution code. The only difference is the data that is used for connection, it’s from different table rows.

Have you tried removing incoming email server and just test with outgoing only? 


@ilyababentsov24  I noticed all the test emails were in the Inbox. So I did just what you suggested, tried the outgoing only, and emails are indeed going out. So I’m good. We only use the outgoing functionality. Thanks.


Reply