0 votes
by (180 points)
edited

Hi,

We're using 2013R2.

When we are trying to use Rebex to send an email to an Office365 server with an attachment > 5MB we get the following error.

Is there any configuration on our side that we could be changing? If not, can anyone shed light on why Office365 would be closing down the connection? I am able to send an attachment of > 5MB through their web interface.

--- Start Exception Stack ---
Rebex.Net.TlsException: Secure connection was closed by the remote connection end. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Rebex.Net.ProxySocket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Rebex.Net.CZ.JD()
at Rebex.Net.CZ.MD(Byte[] A, Int32 B, Int32 C)
--- End of inner exception stack trace ---
at Rebex.Net.CZ.MD(Byte[] A, Int32 B, Int32 C)
at Rebex.Net.TlsSocket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Rebex.Net.UHB.HB(Byte[] A, Int32 B, Int32 C)
at Rebex.Net.Smtp.UBB(WHB A, Int64& B, Int64 C)
at Rebex.Net.Smtp.YBB(Boolean A, String[] B, WHB C, String D, Int64 E)
at Rebex.Net.Smtp.ACB(String A, String[] B, String C, Stream D, TransferEncoding E)
at Rebex.Net.Smtp.GCB(MimeMessage A, Stream B, MailAddress C, MailAddressCollection D)
at Rebex.Net.Smtp.HCB(MailMessage A, MailAddress B, MailAddressCollection C)
at Rebex.Net.Smtp.Send(MailMessage mail, String sender, String recipients)
at prairieFyre.MCC.Server.Common.Models.RebexEmail.Send(String server, Int32 port, String user, String password, Boolean isSSL, Boolean isSmtpAuthenticationRequired, String conversationId)
at Storage.Mailer.Mailer.SendMail(String conversationId, String filePath)
--- End Exception Stack ---

Applies to: Rebex Secure Mail
by (58.9k points)
edited

Hi, please create a log of communication using the LogWriter property and either post the log here or send it to support@rebex.net. We will be able to look into this issue then.

1 Answer

0 votes
by (58.9k points)
edited

Hi,

from the log we guess that the problem might be actually caused by some device along the way which disrupts the process of uploading the attachment via pipelining. It might be a firewall or antivirus program...

To workaround this issue please try to turn off the Pipelining extension of the Smtp client instance like this:

Smtp smtp = new Smtp();
smtp.EnabledExtensions &= ~SmtpExtensions.Pipelining;

Are you able to upload the mail with large attachment now? If not please create a new log file and send it to us. Thank you!

by (180 points)
edited

Hi there,

When I try this, I am able to send the file. However sending a 5MB attachment now takes over 7 minutes.

We are able to reproduce this at serveral customers and also in my development environment. I guess if there is an issue with Office365 this could still explain it. I'll send you your logs just in case... but any thoughts on how we can get this to work without terrible performance?

Thanks, Dan

by (148k points)
edited

Hi,

according to the log, it takes the SMTP server nearly 6 seconds to acknowledge every chunk of data. The chunks are 98KB in size, which means the delay slows down the process a lot. This is very strange.

Please try turning off Chunking extension as well and let us know whether it makes any difference:

smtp.EnabledExtensions &= ~SmtpExtensions.Chunking;

...