Add Remote Mailbox properties/alias/GAL/routing-address management#11
Open
SirTrek wants to merge 3 commits into
Open
Add Remote Mailbox properties/alias/GAL/routing-address management#11SirTrek wants to merge 3 commits into
SirTrek wants to merge 3 commits into
Conversation
The Remote Mailboxes list already linked to /editremotemailbox?id=... but that route and page did not exist, so clicking a mailbox 404'd. Adds a GET /editremotemailbox route plus web/editremotemailbox.html to: - View a mailbox's Name, PrimarySmtpAddress, and RemoteRoutingAddress - Add or remove proxy addresses (EmailAddresses aliases) - Toggle HiddenFromAddressListsEnabled - Change RemoteRoutingAddress Follows the existing pattern used by the other sections: plain GET forms, server-side HTML templating, and the on-prem Recipient Management Tools snap-in already loaded by the script.
The whole request loop ran inside one try/finally with no catch, so any exception writing a response (e.g. the client closes the connection or navigates away before the write completes, surfacing as "The specified network name is no longer available") propagated out of the while loop and killed the entire listener for all users. Wraps each request's handling in its own try/catch so a single failed request is logged and the server keeps listening.
Author
|
Update: this has now been tested against a live on-prem Exchange Management Tools install (Get-RemoteMailbox/Set-RemoteMailbox for viewing properties, adding/removing aliases, toggling HiddenFromAddressListsEnabled, and changing RemoteRoutingAddress) and works as expected. |
Adds a "Danger Zone" card to the Edit Remote Mailbox page with a type-to-confirm control (must type the mailbox's PrimarySmtpAddress before the Disable button enables) backed by a server-side check of the same confirmation text, since the client-side JS is trivially bypassable. Disable-RemoteMailbox strips the Exchange attributes from the AD object; it does not delete the Exchange Online mailbox itself. Since the mailbox no longer exists afterward, the GET handler renders the Remote Mailboxes list directly instead of a 404 edit page for an identity that's gone. Also wraps feather.replace() in try/catch as cheap insurance against icon-library hiccups blocking the confirm-button script - not an active bug on this branch (feather-icons is vendored locally here, not loaded from an unpinned CDN like on the dev branch), but harmless and consistent with the dev-branch fix for the same page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Remote Mailboxes list already links each row to
/editremotemailbox?id=..., but that route and page didn't exist, so clicking a mailbox 404'd. This PR fills that gap and adds the ability to manage the attributes that aren't exposed anywhere else in the tool:Name,PrimarySmtpAddress, andRemoteRoutingAddressEmailAddressesaliases)HiddenFromAddressListsEnabled(hide/unhide from the GAL)RemoteRoutingAddressDisable-RemoteMailbox), behind a type-to-confirm control that requires typing the mailbox'sPrimarySmtpAddressbefore the button enables, checked server-side too so it can't be bypassed client-sideIt follows the app's existing conventions exactly: plain GET forms (no JS/AJAX beyond the type-to-confirm check), server-side HTML placeholder templating, and the on-prem Recipient Management Tools snap-in already loaded by the script — no new dependencies.
A second, unrelated commit fixes a robustness bug found while testing: the whole request loop ran inside a single
try/finallywith nocatch, so any exception writing a response (e.g. a client closing the connection mid-response) crashed the entire webserver for all users. Each request is now handled in its owntry/catch.A third commit adds the disable-mailbox capability above, and wraps the page's
feather.replace()call in try/catch as cheap insurance against icon-library issues blocking the confirm-button script (not an active bug here since this branch vendors feather-icons locally rather than loading it from an unpinned CDN, but harmless and consistent with the same defensive fix I made on a similar page targetingdev).Test plan
Parser]::ParseFileclean (no PowerShell syntax errors)/editremotemailbox?id=...link now resolves instead of 404ingDisable-RemoteMailbox) has been verified on an equivalent page on mydev-targeted branch, but not yet re-tested on this specific branch after porting — I'll confirm and check this box once done