For anyone affected by this bug, since Zimbra was unable to fix a simple line of code in its ActiveSync implementation over the past 6 months, here below is a patch you can apply on proxies to rewrite the User Agent of the Samsung Mail application on the fly and ensure that these clients do negotiate their ActiveSync connection with version 2.5 of the protocol.
To apply the patch, use
After applying the patch and restarting the proxies, you should see Samsung devices showing up in /opt/zimbra/log/access_log.* on every stores with a user agent of SAMSUNG-* as below
This patch has been running in production here for a few hours without causing any troubles so far.
Hope that helps,
Blue.
Code:
--- /tmp/nginx.conf.web.https.template2023-12-12 15:50:33.885796144 +0100+++ nginx.conf.web.https.template2023-12-12 15:50:02.891593046 +0100@@ -28,6 +28,12 @@ set $login_upstream ${web.upstream.webclient.target}; } + # Samsung EAS 2.5 Hack+ set $ua $http_user_agent;+ if ($http_user_agent ~* "^Android-Samsung(.+)$") {+ set $ua "SAMSUNG$1";+ }+ ${web.login.upstream.disable} location = ${web.login.upstream.url}/ ${web.login.upstream.disable} { ${web.login.upstream.disable} set $mailhostport ${web.http.uport}; # replace this with *the* mailhost port@@ -190,6 +196,9 @@ } proxy_set_header Host $virtual_host; + # Samsung EAS 2.5 Hack+ proxy_set_header User-Agent $ua;+ # Location header fudging # Because NGINX SSL speaks plain HTTP to upstream, therefore any # redirects to http:// coming from the upstream need to be fudged
Code:
# backup original filecp /opt/zimbra/conf/nginx/templates/nginx.conf.web.https.template /tmp/nginx.conf.web.https.template.orig# apply patchpatch -b -s -N /opt/zimbra/conf/nginx/templates/nginx.conf.web.https.template -i /tmp/nginx.conf.web.https.template.patch -r -
Code:
82.XX.XXX.XXX - - [12/Dec/2023:16:43:59 +0000] "POST /Microsoft-Server-ActiveSync?Cmd=Sync&User=domain.com%5Cuser&DeviceId=SEC159AA2B675D3A&DeviceType=SamsungDevice HTTP/1.0" 200 88 "-" "SAMSUNG-SM-A505FN/101.11" 60
Hope that helps,
Blue.
Statistics: Posted by Blueberry — Tue Dec 12, 2023 5:00 pm