question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Session Faulted when having large recipient size on version 8 or 9

See original GitHub issue

Bug: Session faulted on a large number of recipients Bug on versions: 8, 9

Starting with version 8 of the library, there is one critical issue that blocks us from updating. This, even though the performance improvements proved to be huge after performing a long load testing session (4-5 times faster in our case).

In our case, the SmtpServer is receiving emails from Exchange and the maximum number of recipients in one transaction is 500. Whenever a user sends an email to a DIstribution List with more than X members, the SmtpServer will immediately fail on Session Faulted throwing the following error. We have seen this happening with 200, 250, 300 recipients, and seeing the error it is clear that it would happen with anything more.

Specified argument was out of the range of valid values. (Parameter 'length')
at System.ThrowHelper.ThrowStartOrEndArgumentValidationException(Int64 start)\r\n   
at System.Buffers.ReadOnlySequence`1.Slice(Int64 start, Int64 length)\r\n  
at SmtpServer.Text.TokenReader.TryMake(TryMakeDelegate delegate, ReadOnlySequence`1& buffer)\r\n  
at SmtpServer.Protocol.SmtpParser.TryMakeMailbox(TokenReader& reader, IMailbox& mailbox)\r\n   
at SmtpServer.Protocol.SmtpParser.TryMakePath(TokenReader& reader, IMailbox& mailbox)\r\n   
at SmtpServer.Protocol.SmtpParser.TryMakeRcpt(TokenReader& reader, SmtpCommand& command, SmtpResponse& errorResponse)\r\n  
at SmtpServer.Protocol.SmtpParser.<TryMake>g__Make|4_0(ReadOnlySequence`1 buffer, TryMakeDelegate tryMakeDelegate, SmtpCommand& command, SmtpResponse& errorResponse)\r\n   
at SmtpServer.Protocol.SmtpParser.TryMake(ReadOnlySequence`1& buffer, SmtpCommand& command, SmtpResponse& errorResponse)\r\n   
at SmtpServer.SmtpSession.<>c__DisplayClass6_0.<ReadCommandAsync>b__0(ReadOnlySequence`1  buffer)\r\n   
at SmtpServer.IO.PipeReaderExtensions.ReadUntilAsync(PipeReader reader, Byte[] sequence, Func`2 func, CancellationToken cancellationToken)\r\n   
at SmtpServer.SmtpSession.ReadCommandAsync(ISessionContext context, CancellationToken cancellationToken)\r\n   
at SmtpServer.SmtpSession.ExecuteAsync(SmtpSessionContext context, CancellationToken cancellationToken)\r\n   
at SmtpServer.SmtpSession.RunAsync(CancellationToken cancellationToken)\r\n   
at SmtpServer.SmtpSessionManager.RunAsync(SmtpSessionHandle handle, CancellationToken cancellationToken)

Unfortunately, this is how Exchange Online deals with distribution lists, expanding them before sending the mail out, so all recipients are listed instead of the distribution list address. The impact of this issue is that emails being sent to distribution lists or lots of recipients are not going through.

Please help and thank you for your work. Let me know if any more logs are needed

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bogdanst24commented, Jun 16, 2021

I can confirm that the issue is fixed now. Thank you!

1reaction
bogdanst24commented, Jun 15, 2021

Awesome! I’ll test it as soon as possible and come back with results

Read more comments on GitHub >

github_iconTop Results From Across the Web

FaultedException on WCF when message size is large
Its simple. When the message size is more than the allowed size i.e. 6000000, it throws a FaultException. Since FaultException is extended ...
Read more >
Troubleshooting Failed Migrations
A 'failed migration' is when the status of the move request shows as ... You cannot offboard an Exchange Online archive mailbox which...
Read more >
FIX Session Layer Online
A FIX session relies on a transport layer to provide for ordered delivery of messages and message recovery during the life of the...
Read more >
RFC 4006 Diameter Credit-Control Application
This document specifies a Diameter application that can be used to implement real-time credit-control for a variety of end user services such as...
Read more >
18.3.2 Group Replication Limitations
The upper size limit for a message that a group member can originate and attempt to transmit to the group is 4294967295 bytes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found