Describe the bug
Sending emails via gmail smtp fails with "The SMTP server has unexpectedly disconnected."
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Sent emails
Logs (Logs directory where Ombi is located)
2019-02-18 19:42:42.943 -05:00 [Error] Exception when attempting to send an email
MailKit.Net.Smtp.SmtpProtocolException: The SMTP server has unexpectedly disconnected.
at MailKit.Net.Smtp.SmtpStream.ReadAheadAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpStream.ReadResponseAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpStream.ReadResponse(CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.SendCommandAsync(String command, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.SendEhloAsync(Boolean ehlo, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.EhloAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.Connect(String host, Int32 port, SecureSocketOptions options, CancellationToken cancellationToken)
at Ombi.Notifications.GenericEmailProvider.SendAdHoc(NotificationMessage model, EmailNotificationSettings settings) in C:\projects\requestplex\src\Ombi.Notifications\GenericEmailProvider.cs:line 81
2019-02-18 19:42:42.946 -05:00 [Warning] Exception when testing Email Notifications
MailKit.Net.Smtp.SmtpProtocolException: The SMTP server has unexpectedly disconnected.
at MailKit.Net.Smtp.SmtpStream.ReadAheadAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpStream.ReadResponseAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpStream.ReadResponse(CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.SendCommandAsync(String command, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.SendEhloAsync(Boolean ehlo, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.EhloAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.Connect(String host, Int32 port, SecureSocketOptions options, CancellationToken cancellationToken)
at Ombi.Notifications.GenericEmailProvider.SendAdHoc(NotificationMessage model, EmailNotificationSettings settings) in C:\projects\requestplex\src\Ombi.Notifications\GenericEmailProvider.cs:line 81
at Ombi.Controllers.External.TesterController.Email(EmailNotificationSettings settings) in C:\projects\requestplex\src\Ombi\Controllers\External\TesterController.cs:line 225
Desktop (please complete the following information):
Ombi Version (please complete the following information):
Additional context
A different app on the same server is able to send mail via the same gmail account and settings. Tried every combination of the two ports (465, 587) and Disable TLS/SSL, Disable Certificate Checking options (just to see), same issue. Seems that it's not even getting to the point of authentication before the connection fails.
Also further evidence that it's not even getting to the point of trying to authenticate, when I look at the app passwords usage on my gmail account, it shows the "last used" for the others, but the one I created specifically for Ombi has no usage.
I am having the same issue ever since updating to the latest release although I have noticed that email is working for some functions. Welcome messages are not working. When I go to settings > Notifications > Email > Test reports an error and doesn't send. New Requests and NewsLetter are working.
as of today, same problem here, cant authenticate
this has happended in this update 3.0.4248
And if you go to the previous version?
worked yesterday in previous version
Please provide your logs
When I try to send a test email from Settings > Notifications > Email I get the following logs.
2019-02-19 07:56:37.634 -06:00 [Error] Exception when attempting to send an email
MailKit.Net.Smtp.SmtpProtocolException: The SMTP server has unexpectedly disconnected.
at MailKit.Net.Smtp.SmtpStream.ReadAheadAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpStream.ReadResponseAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpStream.ReadResponse(CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.SendCommandAsync(String command, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.SendEhloAsync(Boolean ehlo, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.EhloAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.Connect(String host, Int32 port, SecureSocketOptions options, CancellationToken cancellationToken)
at Ombi.Notifications.GenericEmailProvider.SendAdHoc(NotificationMessage model, EmailNotificationSettings settings) in C:\projects\requestplex\src\Ombi.Notifications\GenericEmailProvider.cs:line 81
2019-02-19 07:56:37.638 -06:00 [Warning] Exception when testing Email Notifications
MailKit.Net.Smtp.SmtpProtocolException: The SMTP server has unexpectedly disconnected.
at MailKit.Net.Smtp.SmtpStream.ReadAheadAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpStream.ReadResponseAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpStream.ReadResponse(CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.SendCommandAsync(String command, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.SendEhloAsync(Boolean ehlo, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.EhloAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.Connect(String host, Int32 port, SecureSocketOptions options, CancellationToken cancellationToken)
at Ombi.Notifications.GenericEmailProvider.SendAdHoc(NotificationMessage model, EmailNotificationSettings settings) in C:\projects\requestplex\src\Ombi.Notifications\GenericEmailProvider.cs:line 81
at Ombi.Controllers.External.TesterController.Email(EmailNotificationSettings settings) in C:\projects\requestplex\src\Ombi\Controllers\External\TesterController.cs:line 225
Yesterday I was able to send a test newsletter but today I am not. Here are the logs from that.
Update, Disregard this post. I am able to send test newsletters.
When I try and send a User Welcome email there are no log entries.
I just installed for the first time on v 3.0.4248 via the apt repo.
Tried increasing logging levels but I don't see anything more relevant in the output. My suspicion based on similar stuff found googling the MailKit error is that it's not setting SSL/TLS and the google server is rejecting it early on.
Fixed in develop, will push out a new release today
Fix works for me, thanks!
Most helpful comment
Fixed in develop, will push out a new release today