Mailsync freezes under some proxy


When this problem appears, mailspring client gives “One or more accounts are having Connection Issues” and refuse to refresh.
When try to Re-Auth since a lot of connection issue can be solved by Re-Auth, it gives an error “mailsync: null”.
mailsync would have only one active connection, while I have 5 email account.
At this point, restarting MailSpring client or even killall mailsync would not help.

To Reproduce…

I have configured my network as following:

  • I am using surge 4 on MacOS and are using proxies.
  • I have multiple proxy nodes (most are provided by a company and thus shared) and are setup as Load Balance Group in Surge.
  • After running for about 1-2 days, MailSpring client would not refresh. This have happen to be >5 times so there is a problem.

Expected Behavior



  • OS and Version: macOS Catalnia 10.15.7 build 19H2
  • Mailspring Version: Mailspring 1.7.8 installed from homebrew cask

Current Workaround

  • Turn off wifi to force mailsync connection to fail and then it somehow would work.
  • I have setup some rules to let mailsync use a single proxy node that I own (i.e. <5 users) instead of load balanced group, this seems to solve the problem. My rationale is that some proxy node maybe messing with SOCKS connection, perhaps due to port assignment.

If no bugs can be found in code

Please at least provide a easy way to forcefully restart mailsync, even though command line.

(Originally posted by Ushio-Cheng on GitHub.)

This may be related:

I am seeing this constantly. Using 2 accounts, One G-suite and the other office 365 on Ubuntu 20.04