Session Faulted when having large recipient size on version 8 or 9
See original GitHub issueBug: 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:
- Created 2 years ago
- Reactions:3
- Comments:7 (4 by maintainers)
Top GitHub Comments
I can confirm that the issue is fixed now. Thank you!
Awesome! I’ll test it as soon as possible and come back with results