# Errors while syncing Microsoft accounts

**URL:** <https://community.getmailspring.com/t/errors-while-syncing-microsoft-accounts/7768>\
**Category:** Sync Issues\
**Tags:** linux\
**Created:** [January 29, 2024, 11:01am UTC](https://community.getmailspring.com/t/errors-while-syncing-microsoft-accounts/7768 "2024-01-29T11:01:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggeorgo](https://community.getmailspring.com/user_avatar/community.getmailspring.com/ggeorgo/32/3919_2.png) [@ggeorgo](https://community.getmailspring.com/u/ggeorgo)\
**Post date:** [January 29, 2024, 11:01am UTC](https://community.getmailspring.com/t/errors-while-syncing-microsoft-accounts/7768/1 "2024-01-29T11:01:44Z")

</div>

## Problem

Error while syncing my Microsoft accounts ([msn.com](http://msn.com), [outlook.com](http://outlook.com))

## Context

After keep getting errors for over 5 days, and Clear/Rebuild cache didn’t help, I decided to remove both accounts and add them again.  
Although they are added initially and I am getting the smtp/test emails, if I try to open them, or delete them, I am getting below message:  
“In order to perform actions on this mailbox, you need to resolve the sync issue. Visit Preferences \> Accounts for more information”

## Email Provider

Outlook/MSN

## Setup

- OS and Version: Manjaro KDE Plasma X11. Kernel 6.6.10, KDE 5.27.10
  - Installation Method: Via AUR app store

- Mailspring Version: 1.13.3

Error log:

```auto
    "accounts": [
      {
        "id": "02f5cb08",
        "metadata": [],
        "name": "....,
        "provider": "outlook",
        "emailAddress": "xxxxxx@msn.com",
        "settings": {
          "imap_host": "imap-mail.outlook.com",
          "imap_port": 993,
          "imap_username": "xxxxxx@msn.com",
          "imap_security": "SSL / TLS",
          "imap_allow_insecure_ssl": false,
          "smtp_host": "smtp-mail.outlook.com",
          "smtp_port": 587,
          "smtp_username": "xxxxxxx@msn.com",
          "smtp_security": "STARTTLS",
          "smtp_allow_insecure_ssl": false,
          "container_folder": ""
        },
        "label": "msn.com",
        "autoaddress": {
          "type": "bcc",
          "value": ""
        },
        "aliases": [],
        "syncState": "ok",
        "syncError": {
          "code": 134,
          "error": {
            "stack": "Error: null33941 [2024-01-29 10:50:17.095] [background] [critical] \n ***\n*** Mailspring Sync \n ***An exception occurred during program execution: \n*** {\"debuginfo\":\"syncFoldersAndLabels - fetchAllFolders\",\"key\":\"ErrorAuthentication\",\"retryable\":false,\"what\":\"std::exception\"}\n***\n\n33941 [2024-01-29 10:50:17.095] [background] [critical]*** Stack trace (line numbers are approximate):\n***??:? SyncWorker::syncFoldersAndLabels()\n***??:? runBackgroundSyncWorker()\n***main.cpp:? main::{lambda()#3}::operator()() const\n*** main.cpp:? _Bind_simple::operator()()\n***main.cpp:? thread::_Impl::_M_run()\n*** thread.o:? execute_native_thread_routine()\n***\n\n/usr/share/mailspring/resources/app.asar.unpacked/mailsync: line 5: 33941 Aborted (core dumped) SASL_PATH=\"$SCRIPTPATH\" LD_LIBRARY_PATH=\"$SCRIPTPATH;$LD_LIBRARY_PATH\" \"$SCRIPTPATH/mailsync.bin\" \"$@\"\n\n at ChildProcess.onStreamCloseOrExit (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/src/mailsync-process.ts:320:17)\n at ChildProcess.emit (node:events:513:28)\n at ChildProcess.emit (node:domain:489:12)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)",
            "message": "null33941 [2024-01-29 10:50:17.095] [background] [critical] \n ***\n*** Mailspring Sync \n ***An exception occurred during program execution: \n*** {\"debuginfo\":\"syncFoldersAndLabels - fetchAllFolders\",\"key\":\"ErrorAuthentication\",\"retryable\":false,\"what\":\"std::exception\"}\n***\n\n33941 [2024-01-29 10:50:17.095] [background] [critical]*** Stack trace (line numbers are approximate):\n***??:? SyncWorker::syncFoldersAndLabels()\n***??:? runBackgroundSyncWorker()\n***main.cpp:? main::{lambda()#3}::operator()() const\n*** main.cpp:? _Bind_simple::operator()()\n***main.cpp:? thread::_Impl::_M_run()\n*** thread.o:? execute_native_thread_routine()\n***\n\n/usr/share/mailspring/resources/app.asar.unpacked/mailsync: line 5: 33941 Aborted (core dumped) SASL_PATH=\"$SCRIPTPATH\" LD_LIBRARY_PATH=\"$SCRIPTPATH;$LD_LIBRARY_PATH\" \"$SCRIPTPATH/mailsync.bin\" \"$@\"\n"
          },
          "signal": null
        },
        "authedAt": 1706525436.012,
        "color": "#0000ff",
        "__cls": "Account"
      }

```

---

<div class="post-metadata">

**Author:** ![Striffly](https://community.getmailspring.com/user_avatar/community.getmailspring.com/striffly/32/707_2.png) [@Striffly](https://community.getmailspring.com/u/Striffly)\
**Post date:** [January 29, 2024, 3:55pm UTC](https://community.getmailspring.com/t/errors-while-syncing-microsoft-accounts/7768/2 "2024-01-29T15:55:07Z")

</div>

I got the same problem today. Error when connecting to hotmail / outlook account with application password, even after application password reset.

EDIT : this happens also on my phone device with K9 Mail. Using OAuth2 instead of application password solve the issue.

---

<div class="post-metadata">

**Author:** ![ggeorgo](https://community.getmailspring.com/user_avatar/community.getmailspring.com/ggeorgo/32/3919_2.png) [@ggeorgo](https://community.getmailspring.com/u/ggeorgo)\
**Post date:** [January 29, 2024, 5:24pm UTC](https://community.getmailspring.com/t/errors-while-syncing-microsoft-accounts/7768/3 "2024-01-29T17:24:43Z")

</div>

> [@Striffly](#):
>
> Using OAuth2 instead of application password solve the issue.

How can I change that to Mailspring?

---

<div class="post-metadata">

**Author:** ![Striffly](https://community.getmailspring.com/user_avatar/community.getmailspring.com/striffly/32/707_2.png) [@Striffly](https://community.getmailspring.com/u/Striffly)\
**Post date:** [January 29, 2024, 5:57pm UTC](https://community.getmailspring.com/t/errors-while-syncing-microsoft-accounts/7768/4 "2024-01-29T17:57:49Z")

</div>

Don’t know 🤷‍♂️ I can only do that with K9 Mail  
I tried to use Office 365 login instead of Outlook, but it doesn’t works too

---

<div class="post-metadata">

**Author:** ![ruudschouten](https://community.getmailspring.com/user_avatar/community.getmailspring.com/ruudschouten/32/8307_2.png) [@ruudschouten](https://community.getmailspring.com/u/ruudschouten)\
**Post date:** [January 29, 2024, 8:24pm UTC](https://community.getmailspring.com/t/errors-while-syncing-microsoft-accounts/7768/5 "2024-01-29T20:24:26Z")

</div>

I’ve been having the exact same problem for a while now as well.

I tried removing the account, reinstalling, and downgrading to an older version, none of which worked for long.

I have gotten them working for a short while when adding the accounts via the IMAP / SMTP option, but this no longer works and gives me this error;

```auto
Mailspring Version: 1.13.3-9a7e1a78
Platform: win32
Account State: invalid
Account Provider: imap
IMAP Server: imap-mail.outlook.com
SMTP Server: smtp-mail.outlook.com
--------------------------------------------
***

6952 [2024-01-29 21:11:00.431] [main] [info] Identity created at 1684130933 - using ID Schema 1
6952 [2024-01-29 21:11:00.432] [main] [info] ------------- Starting Sync (xxx.xxx@outlook.com) ---------------
6952 [2024-01-29 21:11:00.434] [metadata] [info] Metadata delta stream starting...
6952 [2024-01-29 21:11:00.434] [background] [info] Marking all folders as `busy`
6952 [2024-01-29 21:11:00.435] [background] [info] Syncing folder list...
6952 [2024-01-29 21:11:01.593] [background] [critical] 
***
*** Mailspring Sync 
*** An exception occurred during program execution: 
*** {"debuginfo":"syncFoldersAndLabels - fetchAllFolders","key":"ErrorAuthentication","retryable":false,"what":"Unknown exception"}
***

16744 [2024-01-29 21:11:01.978] [main] [info] Identity created at 1684130933 - using ID Schema 1
16744 [2024-01-29 21:11:01.979] [main] [info] ------------- Starting Sync (xxx.xxx@outlook.com) ---------------
16744 [2024-01-29 21:11:01.984] [background] [info] Marking all folders as `busy`
16744 [2024-01-29 21:11:01.984] [metadata] [info] Metadata delta stream starting...
16744 [2024-01-29 21:11:01.985] [background] [info] Syncing folder list...
16744 [2024-01-29 21:11:03.160] [background] [critical] 
***
*** Mailspring Sync 
*** An exception occurred during program execution: 
*** {"debuginfo":"syncFoldersAndLabels - fetchAllFolders","key":"ErrorAuthentication","retryable":false,"what":"Unknown exception"}
***

24480 [2024-01-29 21:11:03.618] [main] [info] Identity created at 1684130933 - using ID Schema 1
24480 [2024-01-29 21:11:03.618] [main] [info] ------------- Starting Sync (xxx.xxx@outlook.com) ---------------
24480 [2024-01-29 21:11:03.620] [background] [info] Marking all folders as `busy`
24480 [2024-01-29 21:11:03.620] [metadata] [info] Metadata delta stream starting...
24480 [2024-01-29 21:11:03.622] [background] [info] Syncing folder list...
24480 [2024-01-29 21:11:04.822] [background] [critical] 
***
*** Mailspring Sync 
*** An exception occurred during program execution: 
*** {"debuginfo":"syncFoldersAndLabels - fetchAllFolders","key":"ErrorAuthentication","retryable":false,"what":"Unknown exception"}
***

2096 [2024-01-29 21:11:05.210] [main] [info] Identity created at 1684130933 - using ID Schema 1
2096 [2024-01-29 21:11:05.211] [main] [info] ------------- Starting Sync (xxx.xxx@outlook.com) ---------------
2096 [2024-01-29 21:11:05.213] [background] [info] Marking all folders as `busy`
2096 [2024-01-29 21:11:05.214] [metadata] [info] Metadata delta stream starting...
2096 [2024-01-29 21:11:05.215] [background] [info] Syncing folder list...
2096 [2024-01-29 21:11:06.262] [background] [critical] 
***
*** Mailspring Sync 
*** An exception occurred during program execution: 
*** {"debuginfo":"syncFoldersAndLabels - fetchAllFolders","key":"ErrorAuthentication","retryable":false,"what":"Unknown exception"}
***

```

When I try to add the account with Office 365, I get this error;

```auto
An unknown error has occurred (mailsync: 3765269347)

```

When I try to add the account via [Outlook.com](http://Outlook.com) / Hotmail, I get an Authentication Error, propting me to chech my username and password.  
Where the IMAP log is;

```auto
----------IMAP----------
connect <mailcore::IMAPSession:001AF984>
* OK The Microsoft Exchange IMAP4 service is ready. [RwBWADMAUAAyADgAMABDAEEAMAAwADEAMQAuAFMAVwBFAFAAMgA4ADAALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
ssl connect imap-mail.outlook.com 993 2
OpenSSL version: OpenSSL 1.1.0f 25 May 2017
1 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
1 OK CAPABILITY completed.
connect ok
login
2 LOGIN "xxx.xxx@outlook.com" *********
2 NO LOGIN failed.

```

I should also note that in some cases, the censored password is present in uncensored in plain text in some logs, I am not sure if this makes a difference though.

---

<div class="post-metadata">

**Author:** ![Striffly](https://community.getmailspring.com/user_avatar/community.getmailspring.com/striffly/32/707_2.png) [@Striffly](https://community.getmailspring.com/u/Striffly)\
**Post date:** [January 31, 2024, 5:27pm UTC](https://community.getmailspring.com/t/errors-while-syncing-microsoft-accounts/7768/6 "2024-01-31T17:27:34Z")

</div>

The problem seems do be general with application passwords :

- [Outlook and other apps are unable to connect to Outlook.com - Microsoft Support](https://support.microsoft.com/en-us/office/outlook-and-other-apps-are-unable-to-connect-to-outlook-com-f4202ebf-89c6-4a8a-bec3-3d60cf7deaef)
- [Microsoft Community related topic](https://answers.microsoft.com/en-us/outlook_com/forum/all/outlook-2016-doesnt-accept-password-or-app/b806e4e8-28fd-4b5b-8be2-2b03cf39b938)

The only solution seems to use OAuth2 login for Outlook for the moment, which is not available with Mailspring if I’m right ?

---

<div class="post-metadata">

**Author:** ![jlyman](https://community.getmailspring.com/user_avatar/community.getmailspring.com/jlyman/32/8142_2.png) [@jlyman](https://community.getmailspring.com/u/jlyman)\
**Post date:** [February 1, 2024, 4:33am UTC](https://community.getmailspring.com/t/errors-while-syncing-microsoft-accounts/7768/7 "2024-02-01T04:33:52Z")

</div>

According to [the first link](https://support.microsoft.com/en-us/office/outlook-and-other-apps-are-unable-to-connect-to-outlook-com-f4202ebf-89c6-4a8a-bec3-3d60cf7deaef) by @Striffly, updated on Jan 31, 2024, MS reports that they’ve made adjustments to hopefully improve the situation.

I logged in to my Outlook account to see if there were any blocked sign in attempts, and while doing so it prompted me to add a recovery email to the account. As soon as I did that, mail started flowing into Mailspring again for the Outlook account in question. Probably just a coincidence on the timing, but I’m hoping it stays synced correctly now.

I’ll report back in a couple days if the connection has stayed consistent.

---

<div class="post-metadata">

**Author:** ![ggeorgo](https://community.getmailspring.com/user_avatar/community.getmailspring.com/ggeorgo/32/3919_2.png) [@ggeorgo](https://community.getmailspring.com/u/ggeorgo)\
**Post date:** [February 1, 2024, 10:47am UTC](https://community.getmailspring.com/t/errors-while-syncing-microsoft-accounts/7768/8 "2024-02-01T10:47:12Z")

</div>

> [@jlyman](#):
>
> I’ll report back in a couple days if the connection has stayed consistent.

Mine too are working today, without logging to the accounts from a browser, just from my phone, but I was doing this yesterday too. I think MS made some changes and probably there was a bug, or they reverted them.

---

<div class="post-metadata">

**Author:** ![FunkeyMonkey](https://community.getmailspring.com/user_avatar/community.getmailspring.com/funkeymonkey/32/8954_2.png) [@FunkeyMonkey](https://community.getmailspring.com/u/FunkeyMonkey)\
**Post date:** [July 14, 2024, 2:33am UTC](https://community.getmailspring.com/t/errors-while-syncing-microsoft-accounts/7768/9 "2024-07-14T02:33:35Z")

</div>

Came to add that I had been having problems for the last week and tried your advice and got it working. Soon as i added a backup email to my account mailspring instantly accepted my hotmail account!
