-
-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending to Postal SMTP fails in MailKit 3.4.2 #1467
Comments
I suspect this has something to do with commit 39df387 |
I stepped through the Connect method on SmtpClient, which let me connect without a problem. As soon as I removed the breakpoints, the initially described error occurs. So maybe this is some kind of timing issue? I'll try to find time to get a better grasp of the code in the next days. |
Most likely your SMTP server is responding to the EHLO command with multiple TCP/IP packets (1 per line?) and that is somehow breaking the response parser in SmtpStream.cs When you set breakpoints in that code, it delays SmtpStream.ReadAhead/Async() from reading data from the socket, allowing follow-up TCP/IP packets to arrive before it does a read/async, thus eliminating the issue. |
I wrote a unit test to test that theory the other day (if you are interested in testing the scenario, maybe I should just commit it) but I haven't had time to investigate further because for some reason my Visual Studio for Mac's ability to run the unit tests is broken, so I'll need to switch to my Windows box to run the tests under the debugger. |
… that are sent 1 line per packet May help debugging issue #1467
Thanks! I had a quick look at the unit test. The test currently fails, but with this message:
If I have a look at the resource file, the capabilities found are exactly the ones that should be there, so I'm not sure why the Assert looks for None. Apart from that the test runs through without a problem. |
The Assert in the test is just wrong. |
All right, no worries. I'll see what I can find out. |
…ontain a complete line May fix issue #1467
The above patch may resolve the bug. Let me know? |
Looks good, all my tests with our Postal server are now able to connect and send using that latest commit. Thank you! |
Awesome, thanks for testing my changes! I'll try to make a new 3.4.3 release by early next week (after the holidays). |
Describe the bug
I'm trying to send emails to Postal (self-hosts SES alternative, more or less) via SMTP. This worked without a problem in MailKit 3.4.1 but stopped working in 3.4.2. On the server I can see the EHLO, but the connection is closed afterwards. The behaviour is the same with and without TLS enabled. I'd be happy to provide credentials for a test-organization in a private message/email.
Platform (please complete the following information):
Exception
To Reproduce
Steps to reproduce the behavior:
Expected behavior
MailKit connects to the server and sends the email.
Code Snippets
If applicable, add code snippets to help explain your problem.
Protocol Logs
After this the exception is thrown.
Postal SMTP log:
The text was updated successfully, but these errors were encountered: