jellyfin-plugin-webhook
jellyfin-plugin-webhook copied to clipboard
SMTP issue using IP address
Hi,
I have similar issues when using the email notification plugin. https://github.com/jellyfin/jellyfin/issues/7912. Was told it was deprecated and look into jellyfin-plugin-webhook instead. So I uninstalled the notification plugin and installed jellyfin-plugin-webhook. However it seems to have the same issue of using IP address instead of domain.
Is there a way that IP address could be used in the SMTP address? Please note I have no issues using hostname or sending emails to 192.168.1.1 using sendmail. Thanks in advance.
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)
[2022-06-14 17:24:42.103 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"AccessSchedule"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"ActivityLog"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"CustomItemDisplayPreferences"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"DisplayPreferences"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"HomeSection"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"ImageInfo"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"ItemDisplayPreferences"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"Permission"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"Preference"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"ApiKey"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"Device"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"DeviceOptions"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:42.104 +08:00] [WRN] [11] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"User"' is configured to use schema '"jellyfin"', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2022-06-14 17:24:48.734 +08:00] [WRN] [29] Jellyfin.Plugin.Webhook.Destinations.Smtp.SmtpClient: Error sending email
MailKit.Security.SslHandshakeException: An error occurred while attempting to establish an SSL or TLS connection.
I saw this comment https://github.com/jellyfin-archive/jellyfin-plugin-email/issues/28#issuecomment-958599883. I'm not familiar with .NET but it seems to have the similar code.
In MediaBrowser.Plugins.SmtpNotifications/Notifier.cs on line 52 client.ConnectAsync is called passing in options.SSL which is read from the config file. That value is either or boolean or a string, but neither type is correct. The function requires an enum of type SecureSocketOptions from MailKit.Security
I also saw this https://stackoverflow.com/questions/57008081/when-is-it-necessary-to-enable-ssl-on-mailkit.
To make this less confusing, MailKit has a Connect method that takes a SecureSocketOptions argument instead of a bool. None: Don't use any form of SSL (or TLS). Auto: Automatically decides which type of SSL mode to use based on the specified port. Note: This only works reliable when the port is a standard defined port (e.g. 25, 587 or 465 for SMTP). SslOnConnect: This specifies that MailKit should connect via an SSL-wrapped connection. StartTls: Use the STARTTLS method for SSL/TLS encryption. If the server doesn't support the STARTTLS command, abort the connection. StartTlsWhenAvailable: Use the STARTTLS method for SSL/TLS encryption if the server supports it, otherwise continue using an unencrypted channel.