diff --git a/src/Gallery.CredentialExpiration/Scripts/Gallery.CredentialExpiration.cmd b/src/Gallery.CredentialExpiration/Scripts/Gallery.CredentialExpiration.cmd index 3d6a98472..6098b278e 100644 --- a/src/Gallery.CredentialExpiration/Scripts/Gallery.CredentialExpiration.cmd +++ b/src/Gallery.CredentialExpiration/Scripts/Gallery.CredentialExpiration.cmd @@ -7,8 +7,6 @@ cd bin title #{Jobs.gallery.credentialexpiration.Title} - REM SmtpUri is expected to be of the format: smtps://username:password@host:port. Note that if username contains an "@", you need to URI encode it! - start /w gallery.credentialexpiration.exe -Configuration "#{Jobs.gallery.credentialexpiration.Configuration}" -InstrumentationKey "#{Jobs.gallery.credentialexpiration.InstrumentationKey}" -verbose true -Interval #{Jobs.gallery.credentialexpiration.Interval} echo "Finished #{Jobs.gallery.credentialexpiration.Title}" diff --git a/src/Gallery.CredentialExpiration/Settings/int.json b/src/Gallery.CredentialExpiration/Settings/int.json index 25889b6e4..9ba2b76d4 100644 --- a/src/Gallery.CredentialExpiration/Settings/int.json +++ b/src/Gallery.CredentialExpiration/Settings/int.json @@ -7,7 +7,6 @@ "GalleryAccountUrl": "https://int.nugettest.org/account/ApiKeys", "GalleryBrand": "NuGet Gallery", "MailFrom": "support@nuget.org", - "SmtpUri": "#{Jobs.gallery.credentialexpiration.SmtpUri}", "WarnDaysBeforeExpiration": 7, "WhatIf": true }, diff --git a/src/Gallery.CredentialExpiration/Settings/prod.json b/src/Gallery.CredentialExpiration/Settings/prod.json index 4f9b67756..72b536172 100644 --- a/src/Gallery.CredentialExpiration/Settings/prod.json +++ b/src/Gallery.CredentialExpiration/Settings/prod.json @@ -7,7 +7,6 @@ "GalleryAccountUrl": "https://www.nuget.org/account/ApiKeys", "GalleryBrand": "NuGet Gallery", "MailFrom": "support@nuget.org", - "SmtpUri": "#{Jobs.gallery.credentialexpiration.SmtpUri}", "WarnDaysBeforeExpiration": 7, "WhatIf": false }, diff --git a/src/NuGet.Jobs.Common/Configuration/JobArgumentNames.cs b/src/NuGet.Jobs.Common/Configuration/JobArgumentNames.cs index cf2e4b799..678ebf7f9 100644 --- a/src/NuGet.Jobs.Common/Configuration/JobArgumentNames.cs +++ b/src/NuGet.Jobs.Common/Configuration/JobArgumentNames.cs @@ -111,7 +111,6 @@ public static class JobArgumentNames // Arguments specific to e-mail public const string MailFrom = "MailFrom"; - public const string SmtpUri = "SmtpUri"; // Arguments specific to StatusAggregator public const string StatusStorageAccount = "StatusStorageAccount"; diff --git a/src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj b/src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj index dff362c5d..472bef139 100644 --- a/src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj +++ b/src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj @@ -63,7 +63,6 @@ - diff --git a/src/NuGet.Jobs.Common/SmtpUri.cs b/src/NuGet.Jobs.Common/SmtpUri.cs deleted file mode 100644 index 9dfaf51de..000000000 --- a/src/NuGet.Jobs.Common/SmtpUri.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Net; -using System.Text.RegularExpressions; - -namespace NuGet.Jobs -{ - public class SmtpUri - { - private static readonly Regex _userInfoParser = new Regex("^(?[^:]*):(?.*)$"); - - public string UserName { get; private set; } - public string Password { get; private set; } - public string Host { get; private set; } - public int Port { get; private set; } - public bool Secure { get; private set; } - - public SmtpUri(Uri uri) - { - Secure = uri.Scheme.Equals("smtps", StringComparison.OrdinalIgnoreCase); - if (!Secure && !uri.Scheme.Equals("smtp", StringComparison.OrdinalIgnoreCase)) - { - throw new FormatException($"Invalid SMTP URL: {uri}"); - } - - var m = _userInfoParser.Match(uri.UserInfo); - if (m.Success) - { - UserName = WebUtility.UrlDecode(m.Groups["username"].Value); - Password = WebUtility.UrlDecode(m.Groups["password"].Value); - } - else - { - UserName = WebUtility.UrlDecode(uri.UserInfo); - } - - Host = uri.Host; - Port = uri.IsDefaultPort - ? 25 - : uri.Port; - } - } -} diff --git a/src/NuGet.Services.Validation.Orchestrator/settings.json b/src/NuGet.Services.Validation.Orchestrator/settings.json index d4dd614e6..0344920e9 100644 --- a/src/NuGet.Services.Validation.Orchestrator/settings.json +++ b/src/NuGet.Services.Validation.Orchestrator/settings.json @@ -85,9 +85,6 @@ "TopicPath": "", "SubscriptionName": "" }, - "Smtp": { - "SmtpUri": "" - }, "Email": { "GalleryOwner": "NuGet Gallery ", "GalleryNoReplyAddress": "NuGet Gallery ", diff --git a/src/NuGet.Services.Validation.Orchestrator/symbolsettings.json b/src/NuGet.Services.Validation.Orchestrator/symbolsettings.json index 70eb1cd9b..2b053f48d 100644 --- a/src/NuGet.Services.Validation.Orchestrator/symbolsettings.json +++ b/src/NuGet.Services.Validation.Orchestrator/symbolsettings.json @@ -86,9 +86,6 @@ "TopicPath": "symbol-orchestrator", "SubscriptionName": "orchestrator" }, - "Smtp": { - "SmtpUri": "" - }, "Email": { "GalleryOwner": "NuGet Gallery ", "GalleryNoReplyAddress": "NuGet Gallery ", diff --git a/src/NuGet.SupportRequests.Notifications/JobArgumentNames.cs b/src/NuGet.SupportRequests.Notifications/JobArgumentNames.cs index 5009a6ad7..e499cc6c6 100644 --- a/src/NuGet.SupportRequests.Notifications/JobArgumentNames.cs +++ b/src/NuGet.SupportRequests.Notifications/JobArgumentNames.cs @@ -10,6 +10,5 @@ internal static class JobArgumentNames // avoids value duplication, avoids annoying namespace conflicts in this job public const string InstrumentationKey = Jobs.JobArgumentNames.InstrumentationKey; public const string SourceDatabase = Jobs.JobArgumentNames.SourceDatabase; - public const string SmtpUri = Jobs.JobArgumentNames.SmtpUri; } } \ No newline at end of file