diff --git a/Server/Pages/GetSupport.cshtml.cs b/Server/Pages/GetSupport.cshtml.cs index ed9958570..ee4c2ed0e 100644 --- a/Server/Pages/GetSupport.cshtml.cs +++ b/Server/Pages/GetSupport.cshtml.cs @@ -28,25 +28,26 @@ public IActionResult OnGet() return Page(); } - public async Task OnPost(string deviceID) + public async Task OnPost(string deviceId) { if (!ModelState.IsValid) { return Page(); } - var orgID = _dataService.GetDevice(deviceID)?.OrganizationID; + var orgID = _dataService.GetDevice(deviceId)?.OrganizationID; var alertParts = new string[] { $"{Input.Name} is requesting support.", + $"Device ID: {deviceId}", $"Email: {Input.Email}.", $"Phone: {Input.Phone}.", $"Chat OK: {Input.ChatResponseOk}." }; var alertMessage = string.Join(" ", alertParts); - await _dataService.AddAlert(deviceID, orgID, alertMessage); + await _dataService.AddAlert(deviceId, orgID, alertMessage); var orgUsers = await _dataService.GetAllUsersInOrganization(orgID); var emailMessage = string.Join("
", alertParts); @@ -57,7 +58,7 @@ public async Task OnPost(string deviceID) StatusMessage = "We got it! Someone will contact you soon."; - return RedirectToPage("GetSupport", new { deviceID }); + return RedirectToPage("GetSupport", new { deviceId }); } public class InputModel diff --git a/Server/Pages/ServerConfig.razor b/Server/Pages/ServerConfig.razor index 71b72c931..b0dd73a83 100644 --- a/Server/Pages/ServerConfig.razor +++ b/Server/Pages/ServerConfig.razor @@ -250,6 +250,16 @@
+
+ +
+ This sometimes needs to be disabled for Let's Encrypt certificates. +
+
+ +
+ +

diff --git a/Server/Pages/ServerConfig.razor.cs b/Server/Pages/ServerConfig.razor.cs index 974c26788..c4c5b98d7 100644 --- a/Server/Pages/ServerConfig.razor.cs +++ b/Server/Pages/ServerConfig.razor.cs @@ -84,6 +84,9 @@ public class AppSettingsModel [Display(Name = "SMTP Local Domain")] public string SmtpLocalDomain { get; set; } + [Display(Name = "SMTP Check Certificate Revocation")] + public bool SmtpCheckCertificateRevocation { get; set; } + [Display(Name = "SMTP Password")] public string SmtpPassword { get; set; } @@ -320,7 +323,7 @@ private async Task SaveAndTestSmtpSettings() } else { - ToastService.ShowToast("Error sending email. Check the server logs for details."); + ToastService.ShowToast("Error sending email. Check the server logs for details.", classString: "bg-error"); _alertMessage = "Error sending email. Check the server logs for details."; } } diff --git a/Server/Services/ApplicationConfig.cs b/Server/Services/ApplicationConfig.cs index cb072afe4..a00a28c2c 100644 --- a/Server/Services/ApplicationConfig.cs +++ b/Server/Services/ApplicationConfig.cs @@ -30,6 +30,7 @@ public interface IApplicationConfig string SmtpPassword { get; } int SmtpPort { get; } string SmtpUserName { get; } + bool SmtpCheckCertificateRevocation { get; } Theme Theme { get; } string[] TrustedCorsOrigins { get; } bool UseHsts { get; } @@ -72,6 +73,7 @@ public ApplicationConfig(IConfiguration config) public string SmtpPassword => Config["ApplicationOptions:SmtpPassword"]; public int SmtpPort => int.Parse(Config["ApplicationOptions:SmtpPort"] ?? "25"); public string SmtpUserName => Config["ApplicationOptions:SmtpUserName"]; + public bool SmtpCheckCertificateRevocation => bool.Parse(Config["ApplicationOptions:SmtpCheckCertificateRevocation"] ?? "true"); public Theme Theme => Enum.Parse(Config["ApplicationOptions:Theme"] ?? "Dark", true); public string[] TrustedCorsOrigins => Config.GetSection("ApplicationOptions:TrustedCorsOrigins").Get() ?? System.Array.Empty(); public bool UseHsts => bool.Parse(Config["ApplicationOptions:UseHsts"] ?? "false"); diff --git a/Server/Services/EmailSender.cs b/Server/Services/EmailSender.cs index 0e2f49716..e92816f9b 100644 --- a/Server/Services/EmailSender.cs +++ b/Server/Services/EmailSender.cs @@ -46,6 +46,9 @@ public async Task SendEmailAsync(string toEmail, string replyTo, string su { client.LocalDomain = AppConfig.SmtpLocalDomain; } + + client.CheckCertificateRevocation = AppConfig.SmtpCheckCertificateRevocation; + await client.ConnectAsync(AppConfig.SmtpHost, AppConfig.SmtpPort); await client.AuthenticateAsync(AppConfig.SmtpUserName, AppConfig.SmtpPassword); diff --git a/Server/appsettings.json b/Server/appsettings.json index 3a647bc14..3d6791567 100644 --- a/Server/appsettings.json +++ b/Server/appsettings.json @@ -45,6 +45,7 @@ "SmtpPassword": "", "SmtpPort": 587, "SmtpUserName": "", + "SmtpCheckCertificateRevocation": true, "Theme": "Dark", "TrustedCorsOrigins": [], "UseHsts": false,