From bc39c195767ae04515d186a62adf9543f9650669 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 19 Sep 2014 21:07:56 -0400 Subject: [PATCH] Protect UPN from Deletion when it's not the primary email address --- .../ExchangeServer/ExchangeServerController.cs | 3 +++ .../ExchangeServer/ExchangeMailboxEmailAddresses.ascx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs index cd3cb5d5..025f4c50 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -1347,11 +1347,14 @@ namespace WebsitePanel.EnterpriseServer if (String.Compare(account.PrimaryEmailAddress, email.EmailAddress, true) == 0) { email.IsPrimary = true; + email.ProtectDelete = true; } if (String.Compare(account.UserPrincipalName, email.EmailAddress, true) == 0) { email.IsUserPrincipalName = true; + email.ProtectDelete = true; + } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx index a71c2fa0..d056906f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx @@ -67,7 +67,7 @@ - +