How to use Sailfish OS Exchange Active Sync with Office 365

I have followed the instructions on page How to use Sailfish OS Exchange Active Sync with Office 365 · thaodan.de

I want to connect to my work mail, I have not set it by myself. I get no error during the setup and usage, but the result is:

  1. I can see all my folders in the mail tree (and they are correct)
  2. I cannot see any message, the application reports 0 emails in every folder

I have localized SFOS (Slovene language) 4.4 on Sony Xperia XA. The screenshots my not be undestandable to you.

Also, calendar events are not seen on my phone.

1 Like

By visiting page “outlook.office365.com/mail/options/general/mobile” I can see data as shown on images.



I have no idea about the suspicious “quarantined” status. Not able to find a solution on the web, yet.

looks like something setup by your employer? Did you ask your IT department if they have something in place to only allow “validated devices” to use O365?

I’d second what @cartron suggests. “Quarantined” sounds like it’s something happening on the server side, so you may need to request from your sysadmin for it to be removed from quarantine.

Viewing the logs on your phone may shed further light on things. There are some instructions for doing so on the docs pages (the part about editing the /home/<user>/.config/eas-sailfish.conf file).

If you hit any issues with logging, or are uncertain about the process, please say.

Note that this is likely to cause private data to be output to the logs, so don’t paste the logs here without checking them first, and you should turn off this logging once things are sorted.

As seen from my message, I have also an android phone and the admin responded to me, that they are both equally managed. He will try to find any extra settings for this SFOS phone on MS admin portal, nothing found so far.

I have started debug mode and then started a singled mail referesh task. This is the verbose log I got (anonymized) - it is not helpful to me:

čet. apr. 28 23:06:47 2022 Info: , 0: Sync folders: account:  76 , folderIds:  ("243") , requestId:  4
čet. apr. 28 23:06:47 2022 Info: , 0: Start request: 4 for account 76 at 165118000XXXX
čet. apr. 28 23:06:47 2022 Debug: , 0: AS Command URL:  "https://outlook.office365.com:443/Microsoft-Server-ActiveSync?Cmd=FolderSync&User=robert@com.com&DeviceId=h31133XXXX&DeviceType=SailfishOS"
čet. apr. 28 23:06:47 2022 Debug: , 0: -------------------------------------
čet. apr. 28 23:06:47 2022 Debug: , 0: Sending folder sync command via POST:
čet. apr. 28 23:06:47 2022 Debug:  FolderSyncCommand::start, 84: WBXML tree:
[EAS]START_DOCUMENT
[EAS]<FolderSync>
[EAS]  <SyncKey>1</SyncKey>
[EAS]</FolderSync>
[EAS]END_DOCUMENT
čet. apr. 28 23:06:47 2022 Debug: , 0: -------------------------------------
čet. apr. 28 23:06:47 2022 Info: , 0: reporting sync started 4 for account: 76
čet. apr. 28 23:06:48 2022 Debug: , 0: progress 25 / -1
čet. apr. 28 23:06:48 2022 Debug: , 0: progress 25 / 25
čet. apr. 28 23:06:48 2022 Debug: , 0: =========================
čet. apr. 28 23:06:48 2022 Debug: , 0: Received folder sync command reply:
čet. apr. 28 23:06:48 2022 Debug: , 0: Network error:  QNetworkReply::NetworkError(NoError)
čet. apr. 28 23:06:48 2022 Debug: , 0: Headers:  (QPair("Cache-Control","private"), QPair("Content-Type","application/vnd.ms-sync.wbxml"), QPair("Content-Encoding","gzip"), QPair("Vary","Accept-Encoding"), QPair("Server","Microsoft-IIS/10.0"), QPair("request-id","9ae51bf1-xxxx"), QPair("Strict-Transport-Security","max-age=31536000; includeSubDomains; preload"), QPair("Alt-Svc","h3=\":443\",h3-29=\":443\""), QPair("X-CalculatedFETarget","AM0XXXX.internal.outlook.com"), QPair("X-CalculatedBETarget","AS4XXXX.eurprd05.PROD.OUTLOOK.COM"), QPair("X-BackEndHttpStatus","200, 200"), QPair("X-RUM-Validated","1"), QPair("MS-Server-ActiveSync","15.20"), QPair("X-MS-BackOffDuration","L/-469"), QPair("X-AspNet-Version","4.0.30319"), QPair("X-DiagInfo","AS4XXXX"), QPair("X-BEServer","AS4XXXX"), QPair("X-Proxy-RoutingCorrectness","1"), QPair("X-Proxy-BackendServerStatus","200"), QPair("X-FEProxyInfo","AM6XXXX.EURP194.PROD.OUTLOOK.COM"), QPair("X-FEEFZInfo","DHR"), QPair("X-FirstHopCafeEFZ","DHR"), QPair("X-Powered-By","ASP.NET"), QPair("X-FEServer","AM0XXXX, AM6XXXX"), QPair("Date","Thu, 28 Apr 2022 21:06:47 GMT"))
čet. apr. 28 23:06:48 2022 Debug: , 0: Length:  25
čet. apr. 28 23:06:48 2022 Debug:  FolderSyncCommand::handleFinished, 147: WBXML tree:
[EAS]START_DOCUMENT
[EAS]<FolderSync>
[EAS]  <Status>1</Status>
[EAS]  <SyncKey>1</SyncKey>
[EAS]  <Changes>
[EAS]    <Count>0</Count>
[EAS]  </Changes>
[EAS]</FolderSync>
[EAS]END_DOCUMENT
čet. apr. 28 23:06:48 2022 Debug: , 0: =========================
čet. apr. 28 23:06:48 2022 Info: , 0: Successfully parsed folder sync command response!
čet. apr. 28 23:06:48 2022 Info: , 0: Status: 1
čet. apr. 28 23:06:48 2022 Info: , 0: SyncKey: "1"
čet. apr. 28 23:06:48 2022 Info: , 0: added: ()
čet. apr. 28 23:06:48 2022 Info: , 0: updated: ()
čet. apr. 28 23:06:48 2022 Info: , 0: deleted: ()
čet. apr. 28 23:06:48 2022 Info: , 0: FolderSync command finished:  true
čet. apr. 28 23:06:48 2022 Info: , 0: adding local synchronised folder for sync: "Inbox" "9"
čet. apr. 28 23:06:48 2022 Info: , 0: Marking collection for sync due to needing sync: "Inbox" "9"
čet. apr. 28 23:06:48 2022 Info: , 0: Server ID:  "9" , syncKey:  "209281XXXX"
čet. apr. 28 23:06:48 2022 Info: , 0: Have collection: "9" = "243" with syncKey: "209281XXXX" - requires normal sync.
čet. apr. 28 23:06:48 2022 Info: , 0: initialSync size 0 , sync size 1
čet. apr. 28 23:06:48 2022 Info: , 0: Performing continue sync, collections: 1
čet. apr. 28 23:06:48 2022 Debug: , 0: AS Command URL:  "https://outlook.office365.com:443/Microsoft-Server-ActiveSync?Cmd=Sync&User=robert@com.com&DeviceId=h31133XXXX&DeviceType=SailfishOS"
čet. apr. 28 23:06:48 2022 Debug: , 0: ------------------------------
čet. apr. 28 23:06:48 2022 Debug: , 0: Sending sync command via POST:
čet. apr. 28 23:06:48 2022 Debug:  SyncCommand::start, 108: WBXML tree:
[EAS]START_DOCUMENT
[EAS]<Sync>
[EAS]  <Collections>
[EAS]    <Collection>
[EAS]      <SyncKey>209281XXXX</SyncKey>
[EAS]      <CollectionId>9</CollectionId>
[EAS]      <DeletesAsMoves>0</DeletesAsMoves>
[EAS]      <GetChanges>1</GetChanges>
[EAS]      <Options>
[EAS]        <FilterType>2</FilterType>
[EAS]        <MIMETruncation>0</MIMETruncation>
[EAS]        <MIMESupport>1</MIMESupport>
[EAS]        <BodyPreference>
[EAS]          <Type>1</Type>
[EAS]          <Preview>255</Preview>
[EAS]        </BodyPreference>
[EAS]        <BodyPreference>
[EAS]          <Type>2</Type>
[EAS]          <Preview>255</Preview>
[EAS]        </BodyPreference>
[EAS]      </Options>
[EAS]    </Collection>
[EAS]  </Collections>
[EAS]</Sync>
[EAS]END_DOCUMENT
čet. apr. 28 23:06:48 2022 Debug: , 0: ------------------------------
čet. apr. 28 23:06:48 2022 Debug: , 0: progress 0 / 0
čet. apr. 28 23:06:48 2022 Debug: , 0: =========================
čet. apr. 28 23:06:48 2022 Debug: , 0: Received sync command reply:
čet. apr. 28 23:06:48 2022 Debug: , 0: Network error:  QNetworkReply::NetworkError(NoError)
čet. apr. 28 23:06:48 2022 Debug: , 0: Headers:  (QPair("Cache-Control","private"), QPair("Content-Type","application/vnd.ms-sync.wbxml"), QPair("Server","Microsoft-IIS/10.0"), QPair("request-id","5866fd3f-xxxx"), QPair("Strict-Transport-Security","max-age=31536000; includeSubDomains; preload"), QPair("Alt-Svc","h3=\":443\",h3-29=\":443\""), QPair("X-CalculatedFETarget","AM0XXXX.internal.outlook.com"), QPair("X-CalculatedBETarget","AS4XXXX.eurprd05.PROD.OUTLOOK.COM"), QPair("X-BackEndHttpStatus","200, 200"), QPair("X-RUM-Validated","1"), QPair("MS-Server-ActiveSync","15.20"), QPair("X-MS-BackOffDuration","L/-469"), QPair("X-AspNet-Version","4.0.30319"), QPair("X-DiagInfo","AS4XXXX"), QPair("X-BEServer","AS4XXXX"), QPair("X-Proxy-RoutingCorrectness","1"), QPair("X-Proxy-BackendServerStatus","200"), QPair("X-FEProxyInfo","AM6XXXX.EURP194.PROD.OUTLOOK.COM"), QPair("X-FEEFZInfo","DHR"), QPair("X-FirstHopCafeEFZ","DHR"), QPair("X-Powered-By","ASP.NET"), QPair("X-FEServer","AM0XXXX, AM6XXXX"), QPair("Date","Thu, 28 Apr 2022 21:06:48 GMT"), QPair("Content-Length","0"))
čet. apr. 28 23:06:48 2022 Debug: , 0: Length:  0
čet. apr. 28 23:06:48 2022 Debug:  SyncCommand::handleFinished, 250: QVariant(QString, "WBXML tree: <empty>\n")
čet. apr. 28 23:06:48 2022 Debug: , 0: =========================
čet. apr. 28 23:06:48 2022 Info: , 0: Nothing to parse
čet. apr. 28 23:06:48 2022 Info: , 0: Successfully parsed sync command response!
čet. apr. 28 23:06:48 2022 Info: , 0: status: Eas::SyncStatusUndefined
čet. apr. 28 23:06:48 2022 Info: , 0: limit: 0
čet. apr. 28 23:06:48 2022 Info: , 0: Sync command finished:  true
čet. apr. 28 23:06:48 2022 Info: , 0: Successfully finished sync request!
čet. apr. 28 23:06:48 2022 Info: , 0: Update last synchronized QDateTime(2022-04-28 23:06:48.569 CEST Qt::TimeSpec(LocalTime)) for service "Exchange Email"
čet. apr. 28 23:06:48 2022 Info: , 0: onRequestCompleted: 4 for account 76
čet. apr. 28 23:06:48 2022 Info: , 0: reporting sync completed 4 for account: 76 with status 0
čet. apr. 28 23:06:48 2022 Info: , 0: reporting request  4 finished with status 0
čet. apr. 28 23:06:48 2022 Info: , 0: updating connection account config
čet. apr. 28 23:06:48 2022 Info: , 0: updating email account config
čet. apr. 28 23:06:48 2022 Info: , 0: account 76 updated
čet. apr. 28 23:12:03 2022 Info: , 0: database is released

Thanks for providing your logs and for the careful anonymisation. As far as I can tell from what you posted, the server isn’t returning any errors and the client is acting correctly based on the responses received.

Here’s a breakdown of what’s going on in case it’s of interest (and in case someone notices something I missed).

The client sends out a <FolderSync> message to request any changes from the server, which the server replies to with its own message. Following the Microsoft docs, we can see from the <Count> tag that the server is claiming there are no changes on the server.

The client then makes a request to <Sync> the Inbox folder (folder 9). The server then replies with a message that contains valid headers (no errors), but a completely empty body.

This all fits with your earlier screenshot, which suggests that the device has been quarantined. The Microsoft documentation explains quarantined devices like this:

When a mobile device is quarantined, the mobile device is allowed to connect to the Exchange server. However, it is given only limited access to data. The user can add content to their own Calendar, Contacts, Tasks, and Notes folders but the server won’t allow the device to retrieve any content from the user’s mailbox. The user will receive a single e-mail message that tells them that the mobile device is quarantined.

Did you receive any message about the device being quarantined? If not, then that may be a bug.

I hope this helps, but it does look to me like getting access to your mailbox will require your device to be removed from quarantine at the server end.

My company uses “Conditional Access based multi-factor authentication policies”.
App passwords don’t work with Conditional Access MFA.
Is there a way to implement Conditional Access MFA in Sailfish OS Exchange Active Sync with Office 365.

2 Likes

Unfortunately, starting with today, Microsoft Exchange is not working for my Xperia 10 II. It always complains that there are problems with my credentials. On Android phone is still working without any problems. Has anyone an idea why? Thank you!

I think it’s because Microsoft is starting to disable the old ‘Basic Authentication’ mode.
I don’t use my Sailfish with Exchange, but from the look on the settings page it doesn’t seem to support ‘Modern Authentication’ i.e. using OAuth2, and actually there are a number of threads here in FSO requesting it.
The offical cutting date for Basic Auth in all forms is October 1st, but Microsoft is already doing some sample disabling (e.g. for our business accounts, this week it has been disabled for 48h) so that users are warned about the change.

2 Likes