1

Topic: Active Sync Fix for Microsoft Outlook 365

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version: 1.4.0
- Deployed with iRedMail Easy or the downloadable installer? don't remember many years ago, i have upgraded many times since then.
- Linux/BSD distribution name and version: Debian 10
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySql
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

First it is difficult to add an account with active sync mode i this version of outlook, the instructions here: https://docs.iredmail.org/activesync.outlook.html
do not cover this version of Outlook and should be updated. Here is some instructions on how to add the account:

Step 1: Go to Windows Control Panel > Mail and click Show Profiles.
Step 2: Click Add, enter a name for the profile, and confirm.
Step 3: Select Manual setup or additional server types, and click Next.
Step 4: Select Outlook.com or Exchange ActiveSync compatible service, and click Next.
Step 5: Type the below user, server, and login information then click on ‘Next’ button.
Username: you@example.com
Password: <password>
Mail Server: mail.example.com
Step 6: When Outlook completes the test connection, click Close.
Step 7: Click Finish.

I struggled getting Active Sync working and was getting the error:
"Log onto Exchange ActiveSync mail server (EAS) The server cannot be found"
from Outlook.

I enabled debug mode for SOGo by uncommenting these lines in /etc/sogo/sogo.conf

    SOGoDebugRequests = YES;
    SOGoEASDebugEnabled = YES;
    ImapDebugEnabled = YES;
    LDAPDebugEnabled = YES;
    MySQL4DebugEnabled = YES;
    PGDebugEnabled = YES;

This did not provide any additional insight in the logs there was no errors.

Then i enabled the debug logging in nginx in /etc/nginx/conf-enabled/log.conf and added debug

error_log /var/log/nginx/error.log debug;

This also proved to provide little insight, i could see the successful request coming from outlook, and the response from SOGo also looked valid.
Outlook was sending the correct email address and password (base64 encoded):

OPTIONS /SOGo/Microsoft-Server-ActiveSync HTTP/1.0
Host: 127.0.0.1:20000
Connection: close
User-Agent: Outlook/16.0 (16.0.14931.20008; x64)
X-MS-WL: Outlook/1.0
X-TransactionID: {2E9CF001-D527-4139-B2D5-CED9ECF360CF}
Authorization: Basic <redacted>

and SOGo was responding with a 200 OK:

Server: nginx
Date: Fri, 11 Mar 2022 19:11:45 GMT
Content-Type: text/plain
Content-Length: 0
Connection: keep-alive
Sogo-Request-Duration: 0.001141
Allow: GET, HEAD, POST, OPTIONS, MKCOL, MKCALENDAR, DELETE, PUT, LOCK, UNLOCK, COPY, MOVE, REPORT, PROPFIND, SEARCH
DAV: 1, 2
X-Frame-Options: sameorigin
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Content-Security-Policy: default-src https: data: 'unsafe-inline' 'unsafe-eval'
Referrer-Policy: strict-origin

Finally I found on a sogo forum post that there is a package called "sogo-activesync" so I installed this. After installing this package my problem was gone. Note: during the install it asked if i wanted to overwrite the sogo.conf and I said no keep installed version.

The strange part is, active sync was already working on my phone without this package, so I'm very perplexed.  Is this package required or not? Shouldn't iRedMail have installed it then? Is this just because I am out of date?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Active Sync Fix for Microsoft Outlook 365

Package sogo-activesync is required.