Recurrent syncing problem


Every so often, I’d say around every week or every other week, I get a red message saying that mailspring wasn’t able to connect to my mail account. It started happening for one of my gmail accounts, and then another one started having that same problem.

It’s not much of a hassle, I just have to sign up again in google, but it is becoming annoying.

It gives back this error code:
Mailspring Sync
*** An exception occurred during program execution:
*** {“debuginfo”:“ RETURNED {\n “error”: “unauthorized_client”,\n “error_description”: “Unauthorized”\n}”,“key”:“Invalid Response Code: 401”,“retryable”:false,“what”:“Unknown exception”}


Every so often when I open mailspring I get a red window saying that mailspring could not connect to my account

Email Provider

I’m using gmail on the 3 accounts I have connected with mailspring


  • OS and Version: Windows 10 version 22H2 (i’m not sure about the version, I’m using windows 10 with x64)
    • Installation Method: I don’t remember, I think I used the .exe downloaded from the web page
  • Mailspring Version: 1.10.8-8ea2a61f

Just a quick note that Google/Gmail is increasing their security and authentication requirements around third-party email clients accessing their system. More info is here:

This could be a problem with your particular “2-Step Verification” settings at Gmail, or it could be a bug in Mailspring. One of the easiest ways around this is to set an app-specific password:

I hope that helps…

I think that might help, I’ve checked and, apparently the account that doesn’t fail has the two step authentication activated, while the other two didn’t have it. I’ve tried changing the settings so all the accounts have the two step authentication. Hopefully that will end the problem.

I’ll tell you in a couple of weeks if it worked or not.

Thanks anyway

Apparently, It didn’t help, I got the same error again.

Fortunately, I found another post similar to mine, where a viable solution was mentioned (Mailspring keeps disconnecting from gmail account - #3 by BlackChristianGeek).

If I keep having problems I’ll try that, and hope for the best

Another option I’m thinking of is complete reinstalation of the program, It’s going to be a bit of a hassle, but I think that will probably solve everything


Yes, the post you referenced is describing the fix as using “App Passwords” along with a clean Mailspring configuration. The detailed steps for creating App Passwords in your two-step verification settings are in the second link I provided).

Let us know how it works out :+1:

I’ll post the reply I did in the other thread here because I’m lazy:

Well, I tried making the imap and deleting the whole app and it seems to keeep being an isue, as I just received the same problem again in all the accounts (In the ones I had with imap, the one I left without imap, and even in the one with office 365, which suppossedly didn’t have that problem). Strangely, the first account I connected still does not give me any kind of error, weird…

well, It seems it’s reconnecting time every so often…