From 8db3cae826a00f26d0f5e5dfa10a284e6bc4c0dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= <1113810+ThxGiving@users.noreply.github.com> Date: Tue, 20 Oct 2026 20:48:30 +0200 Subject: [PATCH] [Nginx] Send Basic auth challenge for unauthenticated ActiveSync requests Outlook for iOS/Android connects through Microsoft's sync service, which sends each EAS command without credentials first and only retries with Basic auth after a 401 + WWW-Authenticate challenge. SOGo answers these unauthenticated POSTs (Provision, FolderSync, Sync, ...) with 403, so the Outlook apps never get past Provision and show an empty mailbox (#5846). Answer requests without an Authorization header with a Basic challenge in nginx before they reach SOGo. Clients that send credentials up front are not affected. --- data/conf/nginx/templates/sites-default.conf.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/data/conf/nginx/templates/sites-default.conf.j2 b/data/conf/nginx/templates/sites-default.conf.j2 index 842c50a54..13f6fda10 100644 --- a/data/conf/nginx/templates/sites-default.conf.j2 +++ b/data/conf/nginx/templates/sites-default.conf.j2 @@ -184,6 +184,12 @@ location /sogo-auth-verify { } location ^~ /Microsoft-Server-ActiveSync { + # Outlook for iOS/Android (Microsoft's sync service) sends EAS commands without credentials + # and only authenticates after a 401 Basic challenge. SOGo answers those with 403, so challenge here. + if ($http_authorization = "") { + add_header WWW-Authenticate 'Basic realm="SOGo"' always; + return 401; + } auth_request /sogo-auth-verify; auth_request_set $user $upstream_http_x_user; auth_request_set $auth $upstream_http_x_auth;