I manage 2 computers, both 2017 MacBook Pros. One of which is running macOS High Sierra 10.13.x (latest sub version) for about 6 months. The other one was running the same, but is now running macOS Mojave 10.14.x.
I have 8 email accounts setup on both computers, 6 of which are Google Apps emails accounts (Gmail accounts running on a private domain). The other two are:
3rd party IMAP/SMTP.
I use macOS Mail.app to manage all these email accounts.
For the Google apps accounts, i have two-factor authentication enabled, so when you add the accounts for the first time, the wizard takes you through the two-factor authentication process.
All the email accounts have worked fine for the past 6 months.
I rarely shutdown the computers, but put them into sleep mode instead.
One day about 2 weeks ago, I came in and opened up the computers and all the Google Apps email accounts in the Mail.app connection doctor were showing login errors relating to the IMAP and SMTP usernames and passwords. This was strange as all the accounts stopped working at the same time. This is happening on both computers.
I went through the accounts one by one and re-entered the passwords and went through the two-factor authentication process. The accounts worked fine for the rest of the day.
Next day I opened the computers and the exact same error re-occurred. I tried relaunching Mail.app, but to no avail. I then tried restarting the computers, which allowed the email to connect.
Next day the exact same error re-occurred. I restarted the computers and the email accounts connected fine. Ive also found that on occasions that if i delete the keychain tokens for one account, the password and 2FA up again for that one account, it can sometimes make all the other accounts active again. It definatley is an Mac Mail issue, as the accounts will always continue to work via iOS Mail.
So I've been able to find a workaround for the issue, but by no means a permanent fix. Any ideas why this could be happening and what could be done to fix it permanently?
I've had a similar issue years ago that I posted here:
but the fix that worked back then dose not appear to be working now.