Skip to content
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

SMTP issue using IP address #120

Closed
Nazar78 opened this issue Jun 14, 2022 · 1 comment · Fixed by #258
Closed

SMTP issue using IP address #120

Nazar78 opened this issue Jun 14, 2022 · 1 comment · Fixed by #258
Labels
bug This PR or Issue describes or fixes something that isn't working feature This PR or Issue requests or introduces a new feature

Comments

@Nazar78
Copy link

Nazar78 commented Jun 14, 2022

Hi,

I have similar issues when using the email notification plugin. jellyfin/jellyfin#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.

image

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.
@Nazar78
Copy link
Author

Nazar78 commented Jun 16, 2022

I saw this comment jellyfin-archive/jellyfin-plugin-email#28 (comment). 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.

@crobibero crobibero added bug This PR or Issue describes or fixes something that isn't working feature This PR or Issue requests or introduces a new feature labels Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This PR or Issue describes or fixes something that isn't working feature This PR or Issue requests or introduces a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants