jellyfin-plugin-webhook
                                
                                
                                
                                    jellyfin-plugin-webhook copied to clipboard
                            
                            
                            
                        System.ObjectDisposedException: Cannot access a disposed object.
[WRN] Error sending email
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
   at System.Net.Sockets.Socket.ThrowObjectDisposedException()
   at System.Net.Sockets.Socket.GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName)
   at System.Net.Sockets.Socket.get_ReceiveTimeout()
   at MailKit.Net.NetworkStream.get_ReadTimeout()
   at MailKit.Net.NetworkStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
   at MailKit.Net.Smtp.SmtpStream.ReadAheadAsync(Boolean doAsync, CancellationToken cancellationToken)
   at MailKit.Net.Smtp.SmtpStream.ReadResponseAsync(Boolean doAsync, CancellationToken cancellationToken)
   at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Webhook.Destinations.Smtp.SmtpClient.SendAsync(SmtpOption option, Dictionary`2 data
Is this an error on my part or Jellyfin? I can not find reference on this issue.
What version of Jellyfin are you using? What version of the plugin are you using?
It's likely an issue in the plugin, but without any basic info it is impossible to say.
Yes sorry. Jellyfin 10.8.13 Plugin: 11.0.0.0 Linux (non docker)
If it helps I believe the server is having a issue with web socks
WS "IP" error receiving data: "The remote party closed the WebSocket connection without completing the close handshake.".
Also this spams the logs very badly
Queuing task "ItemAddedScheduledTask" INF] Executing "Webhook Item Added Notifier" [INF] "Webhook Item Added Notifier" Completed after 0 minute(s) and 0 seconds
Unfortunatly I was unable to reproduce the issue using Jellyfin v10.9 (unstable masteR) and plugin v12.2404.8.0 so I'm not sure how to help from here
It's possible that the SMTP server isn't configured correctly
From the logs below trying to get Jellyfin (SSL) to connect to mail server, it could be a SSL error that cause the first issue as JF may have connected but not able to send email.
`MailKit.Security.SslHandshakeException: An error occurred while attempting to establish an SSL or TLS connection.
When connecting to an SMTP service, port 587 is typically reserved for plain-text connections. If
you intended to connect to SMTP on the SSL port, try connecting to port 465 instead. Otherwise,
if you intended to use STARTTLS, make sure to use the following code:
client.Connect ("172.18.0.2", 587, SecureSocketOptions.StartTls);
 ---> System.IO.IOException: Cannot determine the frame size or a corrupted frame was received.
   at System.Net.Security.SslStream.GetFrameSize(ReadOnlySpan`1 buffer)
   at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](TIOAdapter adapter)
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
   at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Webhook.Destinations.Smtp.SmtpClient.SendAsync(SmtpOption option, Dictionary`2 data)
I think it is a bug, when use SSL is unchecked it still tries to connect over ssl.
`MailKit.Security.SslHandshakeException: An error occurred while attempting to establish an SSL or TLS connection.
The host name did not match the name given in the server's SSL certificate.
 ---> System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.
   at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception)
   at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
   at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Webhook.Destinations.Smtp.SmtpClient.SendAsync(SmtpOption option, Dictionary`2 data)`
SSL unchecked on port 25 (I can connect on port 25 in other apps)
The host name did not match the name given in the server's SSL certificate.
I also think this links with https://github.com/jellyfin/jellyfin-plugin-webhook/issues/120
Using localhost as host and port 25:
The host name did not match the name given in the server's SSL certificate.