Update SixLabors.ImageSharp, MailKit, DryIoc libraries

Closes #8282

Co-Authored-By: Stepan Goremykin <25577658+goremykin@users.noreply.github.com>
pull/8372/head
Qstick 2 years ago
parent cc285fab45
commit a7ba1a6454

@ -4,7 +4,7 @@
<DefineConstants Condition="'$(RuntimeIdentifier)' == 'linux-musl-x64' or '$(RuntimeIdentifier)' == 'linux-musl-arm64'">ISMUSL</DefineConstants> <DefineConstants Condition="'$(RuntimeIdentifier)' == 'linux-musl-x64' or '$(RuntimeIdentifier)' == 'linux-musl-arm64'">ISMUSL</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DryIoc.dll" Version="5.3.0" /> <PackageReference Include="DryIoc.dll" Version="5.3.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.1" /> <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.2" />

@ -42,11 +42,9 @@ namespace NzbDrone.Core.MediaCover
try try
{ {
using (var image = Image.Load(source)) using var image = Image.Load(source);
{ image.Mutate(x => x.Resize(0, height));
image.Mutate(x => x.Resize(0, height)); image.Save(destination);
image.Save(destination);
}
} }
catch catch
{ {

@ -83,23 +83,6 @@ namespace NzbDrone.Core.Notifications.Email
return new ValidationResult(failures); return new ValidationResult(failures);
} }
public ValidationFailure Test(EmailSettings settings)
{
const string body = "Success! You have properly configured your email notification settings";
try
{
SendEmail(settings, "Radarr - Test Notification", body);
}
catch (Exception ex)
{
_logger.Error(ex, "Unable to send test email");
return new ValidationFailure("Server", "Unable to send test email");
}
return null;
}
private void SendEmail(EmailSettings settings, string subject, string body, bool htmlBody = false) private void SendEmail(EmailSettings settings, string subject, string body, bool htmlBody = false)
{ {
var email = new MimeMessage(); var email = new MimeMessage();
@ -129,52 +112,67 @@ namespace NzbDrone.Core.Notifications.Email
throw; throw;
} }
_logger.Debug("Finished sending email. Subject: {0}", email.Subject); _logger.Debug("Finished sending email. Subject: {0}", subject);
} }
private void Send(MimeMessage email, EmailSettings settings) private void Send(MimeMessage email, EmailSettings settings)
{ {
using (var client = new SmtpClient()) using var client = new SmtpClient();
{ client.Timeout = 10000;
client.Timeout = 10000;
var serverOption = SecureSocketOptions.Auto; var serverOption = SecureSocketOptions.Auto;
if (settings.RequireEncryption) if (settings.RequireEncryption)
{
if (settings.Port == 465)
{
serverOption = SecureSocketOptions.SslOnConnect;
}
else
{ {
if (settings.Port == 465) serverOption = SecureSocketOptions.StartTls;
{
serverOption = SecureSocketOptions.SslOnConnect;
}
else
{
serverOption = SecureSocketOptions.StartTls;
}
} }
}
client.ServerCertificateValidationCallback = _certificateValidationService.ShouldByPassValidationError; client.ServerCertificateValidationCallback = _certificateValidationService.ShouldByPassValidationError;
_logger.Debug("Connecting to mail server"); _logger.Debug("Connecting to mail server");
client.Connect(settings.Server, settings.Port, serverOption); client.Connect(settings.Server, settings.Port, serverOption);
if (!string.IsNullOrWhiteSpace(settings.Username)) if (!string.IsNullOrWhiteSpace(settings.Username))
{ {
_logger.Debug("Authenticating to mail server"); _logger.Debug("Authenticating to mail server");
client.Authenticate(settings.Username, settings.Password); client.Authenticate(settings.Username, settings.Password);
} }
_logger.Debug("Sending to mail server");
_logger.Debug("Sending to mail server"); client.Send(email);
client.Send(email); _logger.Debug("Sent to mail server, disconnecting");
_logger.Debug("Sent to mail server, disconnecting"); client.Disconnect(true);
client.Disconnect(true); _logger.Debug("Disconnecting from mail server");
}
public ValidationFailure Test(EmailSettings settings)
{
const string body = "Success! You have properly configured your email notification settings";
_logger.Debug("Disconnecting from mail server"); try
{
SendEmail(settings, "Radarr - Test Notification", body);
}
catch (Exception ex)
{
_logger.Error(ex, "Unable to send test email");
return new ValidationFailure("Server", "Unable to send test email");
} }
return null;
} }
private MailboxAddress ParseAddress(string type, string address) private MailboxAddress ParseAddress(string type, string address)

@ -32,7 +32,8 @@ namespace NzbDrone.Core.Notifications.Email
public EmailSettings() public EmailSettings()
{ {
Port = 567; Port = 587;
To = Array.Empty<string>(); To = Array.Empty<string>();
Cc = Array.Empty<string>(); Cc = Array.Empty<string>();
Bcc = Array.Empty<string>(); Bcc = Array.Empty<string>();

@ -5,7 +5,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Dapper" Version="2.0.123" /> <PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Equ" Version="2.3.0" /> <PackageReference Include="Equ" Version="2.3.0" />
<PackageReference Include="MailKit" Version="2.15.0" /> <PackageReference Include="MailKit" Version="3.6.0" />
<PackageReference Include="Npgsql" Version="6.0.3" /> <PackageReference Include="Npgsql" Version="6.0.3" />
<PackageReference Include="Servarr.FFMpegCore" Version="4.7.0-26" /> <PackageReference Include="Servarr.FFMpegCore" Version="4.7.0-26" />
<PackageReference Include="Servarr.FFprobe" Version="5.1.2.106" /> <PackageReference Include="Servarr.FFprobe" Version="5.1.2.106" />
@ -17,7 +17,7 @@
<PackageReference Include="Servarr.FluentMigrator.Runner.SQLite" Version="3.3.2.9" /> <PackageReference Include="Servarr.FluentMigrator.Runner.SQLite" Version="3.3.2.9" />
<PackageReference Include="Servarr.FluentMigrator.Runner.Postgres" Version="3.3.2.9" /> <PackageReference Include="Servarr.FluentMigrator.Runner.Postgres" Version="3.3.2.9" />
<PackageReference Include="FluentValidation" Version="8.6.2" /> <PackageReference Include="FluentValidation" Version="8.6.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" /> <PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="NLog" Version="5.0.1" /> <PackageReference Include="NLog" Version="5.0.1" />
<PackageReference Include="System.Data.SQLite.Core.Servarr" Version="1.0.115.5-18" /> <PackageReference Include="System.Data.SQLite.Core.Servarr" Version="1.0.115.5-18" />

@ -7,8 +7,8 @@
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" /> <PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.1" /> <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.3.0" /> <PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.3.0" />
<PackageReference Include="DryIoc.dll" Version="5.3.0" /> <PackageReference Include="DryIoc.dll" Version="5.3.4" />
<PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="6.1.0" /> <PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="6.1.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\NzbDrone.Common\Radarr.Common.csproj" /> <ProjectReference Include="..\NzbDrone.Common\Radarr.Common.csproj" />

@ -4,8 +4,8 @@
<TargetFrameworks>net6.0</TargetFrameworks> <TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DryIoc.dll" Version="5.3.0" /> <PackageReference Include="DryIoc.dll" Version="5.3.4" />
<PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="6.1.0" /> <PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="6.1.1" />
<PackageReference Include="NLog" Version="5.0.1" /> <PackageReference Include="NLog" Version="5.0.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

Loading…
Cancel
Save