fix(management): EWS write gate requires username:password credentials

This commit is contained in:
Joseph Doherty
2026-08-10 06:48:15 -04:00
parent 8df15b34b8
commit acbb9eafa5
3 changed files with 168 additions and 1 deletions
@@ -2213,7 +2213,7 @@ public class ManagementActor : ReceiveActor
{
throw new ManagementCommandException(
"EWS transport requires Host to be an absolute https:// EWS endpoint URL "
+ "(e.g. https://mail.example.com/ews/exchange.asmx).");
+ $"(e.g. https://mail.example.com/ews/exchange.asmx); got '{config.Host}'.");
}
// The EWS sender authenticates with HTTP Basic only — no OAuth2 flow exists
@@ -2223,6 +2223,19 @@ public class ManagementActor : ReceiveActor
throw new ManagementCommandException(
"EWS transport supports only Basic authentication; set AuthMode to 'basic'.");
}
// Same split semantics as the delivery adapter: FIRST colon only, because a
// domain-qualified user name contains none but a password legitimately may.
// Without this the common mistake — flipping an existing SMTP row (whose
// Credentials is a bare password) to Ews — would persist happily and then park
// every single notification at delivery time.
var credentialParts = config.Credentials?.Split(':', 2) ?? [];
if (credentialParts.Length != 2 || credentialParts[0].Length == 0 || credentialParts[1].Length == 0)
{
throw new ManagementCommandException(
"EWS transport requires Credentials in 'username:password' form "
+ "(username may be 'domain\\user').");
}
}
/// <summary>