0 votes
by (270 points)

Dear Rebex team
My company uses Rebex.Mail version 2.0.6339.0 and we got an exception
Rebex.Net.SmtpException: An existing connection was forcibly closed by the remote host ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Rebex.Net.ProxySocket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Rebex.Net.RBV.AX()
at Rebex.Net.RBV.HX(String& U)
at Rebex.Net.RBV.CX()
at Rebex.Net.Smtp.MT(Int32 U, Boolean Q)
--- End of inner exception stack trace ---
at Rebex.Net.Smtp.MT(Int32 U, Boolean Q)
at Rebex.Net.Smtp.NEX(Boolean U, String[] Q, KBV V, String L, Int64 I)
at Rebex.Net.Smtp.YAX(MimeMessage U, Stream Q, MailAddress V, MailAddressCollection L)
at Rebex.Net.Smtp.LAX(MimeMessage U, MailAddress Q, MailAddressCollection V)
at Rebex.Net.Smtp.Send(MimeMessage mail, String sender, String recipients)
at Merge1.Targets.SMTPTarget.SMTPConnection.SendMessageStream(MimeMessage messageMime, Int64 id)

Is there a way to get more verbose logs? Is this is common issue you could help to resolve? This happens for only one message.
Thank you

Applies to: Rebex Secure Mail
by (270 points)
Also is there a default timeout for sending messages to SMTP and recreating connection?

1 Answer

+1 vote
by (148k points)
selected by
 
Best answer

This looks like the server closed the connection while receive the message. This used to be quite common some years ago (buggy antivirus software was the most common cause), but it's not very common any more. A communication log might make it possible to tell what is going on.

You can create logs at various levels of verbosity using Smtp object's LogWriter property. LogLevel.Debug is sufficient in many cases. The most log level verbose is LogLevel.Verbose - this will result in a log that includes the communication between the client and the server (be careful with these logs - they might include credentials or other sensitive data).

Timeout (in miliseconds) can be specified using Smtp object's Timeout property. Default timeout value is 60000 (60 seconds).

by (270 points)
What is the mail size's unit of measurement, byte or kilobyte? I got the following log after switching on Verbose logging for SMTP
INFO Smtp(15)[16] Command: MAIL FROM:<ews@*****.local> SIZE=12830590
What is the size of the message in this case?
by (148k points)
It's in bytes, so the size of the message in this case is about 12.8 MB. For detailed specification, see https://tools.ietf.org/html/rfc1870
by (270 points)
OK, thank you
...