From c41bef33a4a00700847e0149b621713b4d51ce16 Mon Sep 17 00:00:00 2001 From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch> Date: Mon, 29 Apr 2019 21:39:56 +0200 Subject: [PATCH] Fix spelling of "address" in code and config Fixes #72 --- ATxCommon/Serializables/ServiceConfig.cs | 8 ++++---- ATxService/AutoTx.cs | 12 ++++++------ ATxService/Email.cs | 8 ++++---- Resources/conf/config.common.xml | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ATxCommon/Serializables/ServiceConfig.cs b/ATxCommon/Serializables/ServiceConfig.cs index 82aace4..8161ce1 100644 --- a/ATxCommon/Serializables/ServiceConfig.cs +++ b/ATxCommon/Serializables/ServiceConfig.cs @@ -193,12 +193,12 @@ namespace ATxCommon.Serializables /// <summary> /// The mail recipient address for admin notifications (including "Fatal" log messages). /// </summary> - public string AdminEmailAdress { get; set; } + public string AdminEmailAddress { get; set; } /// <summary> /// The mail recipient address for debug notifications (including "Error" log messages). /// </summary> - public string AdminDebugEmailAdress { get; set; } + public string AdminDebugEmailAddress { get; set; } /// <summary> /// Send an email to the user upon completed transfers. Default: true. @@ -559,8 +559,8 @@ namespace ATxCommon.Serializables $"SmtpPasswortCredential: --- not showing ---\n" + $"EmailFrom: {EmailFrom}\n" + $"EmailPrefix: {EmailPrefix}\n" + - $"AdminEmailAdress: {AdminEmailAdress}\n" + - $"AdminDebugEmailAdress: {AdminDebugEmailAdress}\n" + + $"AdminEmailAddress: {AdminEmailAddress}\n" + + $"AdminDebugEmailAddress: {AdminDebugEmailAddress}\n" + $"SendTransferNotification: {SendTransferNotification}\n" + $"SendAdminNotification: {SendAdminNotification}\n" + $"AdminNotificationDelta: {AdminNotificationDelta} min (" + diff --git a/ATxService/AutoTx.cs b/ATxService/AutoTx.cs index 3968540..5703786 100644 --- a/ATxService/AutoTx.cs +++ b/ATxService/AutoTx.cs @@ -174,15 +174,15 @@ namespace ATxService /// Configure logging to email targets. /// /// Depending on the configuration, set up the logging via email. If no SmtpHost or no - /// AdminEmailAdress is configured, nothing will be done. If they're set in the config file, + /// AdminEmailAddress is configured, nothing will be done. If they're set in the config file, /// a log target for messages with level "Fatal" will be configured. In addition, if the - /// AdminDebugEmailAdress is set, another target for "Error" level messages is configured + /// AdminDebugEmailAddress is set, another target for "Error" level messages is configured /// using this address as recipient. /// </summary> private void SetupMailLogging() { try { if (string.IsNullOrWhiteSpace(_config.SmtpHost) || - string.IsNullOrWhiteSpace(_config.AdminEmailAdress)) { + string.IsNullOrWhiteSpace(_config.AdminEmailAddress)) { Log.Info("SMTP host or admin recipient unconfigured, disabling mail logging."); return; } @@ -202,7 +202,7 @@ namespace ATxService SmtpServer = _config.SmtpHost, SmtpPort = _config.SmtpPort, From = _config.EmailFrom, - To = _config.AdminEmailAdress, + To = _config.AdminEmailAddress, Subject = subject, Body = body, }; @@ -215,13 +215,13 @@ namespace ATxService logConfig.AddRuleForOneLevel(LogLevel.Fatal, mailTargetFatalLimited); // "Error" target - if (!string.IsNullOrWhiteSpace(_config.AdminDebugEmailAdress)) { + if (!string.IsNullOrWhiteSpace(_config.AdminDebugEmailAddress)) { var mailTargetError = new MailTarget { Name = "mailerror", SmtpServer = _config.SmtpHost, SmtpPort = _config.SmtpPort, From = _config.EmailFrom, - To = _config.AdminDebugEmailAdress, + To = _config.AdminDebugEmailAddress, Subject = subject, Body = body, }; diff --git a/ATxService/Email.cs b/ATxService/Email.cs index df59f29..98c129d 100644 --- a/ATxService/Email.cs +++ b/ATxService/Email.cs @@ -74,7 +74,7 @@ namespace ATxService } /// <summary> - /// Send a notification email to the AdminEmailAdress. + /// Send a notification email to the AdminEmailAddress. /// </summary> /// <param name="body">The email text.</param> /// <param name="subject">Optional subject for the email.</param> @@ -96,9 +96,9 @@ namespace ATxService body = $"Notification from: {_config.HostAlias} ({Environment.MachineName})\n\n{body}"; Log.Debug("Sending an admin notification email."); - SendEmail(_config.AdminEmailAdress, subject, body); + SendEmail(_config.AdminEmailAddress, subject, body); _status.LastAdminNotification = DateTime.Now; - Log.Debug("{0} sent to AdminEmailAdress.", subject); + Log.Debug("{0} sent to AdminEmailAddress.", subject); return true; } @@ -139,7 +139,7 @@ namespace ATxService // explicitly use SendEmail() instead of SendAdminEmail() here to circumvent the // additional checks done in the latter one and make sure the low space email is // sent out independently of that: - SendEmail(_config.AdminEmailAdress, "low disk space", body); + SendEmail(_config.AdminEmailAddress, "low disk space", body); } catch (Exception ex) { Log.Error("Error loading email template: {0}", ex.Message); diff --git a/Resources/conf/config.common.xml b/Resources/conf/config.common.xml index 5665558..2e09268 100644 --- a/Resources/conf/config.common.xml +++ b/Resources/conf/config.common.xml @@ -92,13 +92,13 @@ <!-- EmailPrefix: prefix label for email subjects --> <EmailPrefix>[Core Facility] </EmailPrefix> - <!-- AdminEmailAdress: an email address for admin notifications (including + <!-- AdminEmailAddress: an email address for admin notifications (including "Fatal" log messages) --> - <AdminEmailAdress>admin@mydomain.xy</AdminEmailAdress> + <AdminEmailAddress>admin@mydomain.xy</AdminEmailAddress> - <!-- AdminDebugEmailAdress: an email address where to send certain debug + <!-- AdminDebugEmailAddress: an email address where to send certain debug messages to, e.g. on completed transfers --> - <AdminDebugEmailAdress>admin@mydomain.xy</AdminDebugEmailAdress> + <AdminDebugEmailAddress>admin@mydomain.xy</AdminDebugEmailAddress> <!-- SendTransferNotification: send email to user on finished transfers --> <SendTransferNotification>true</SendTransferNotification> -- GitLab