Background from https://www.varac-hamradio.com/forum/bug-reports/smtp-imap-authentication-issues is below. I've tried the App password with and without the spaces. Sorry about my delayed reply, Irad. Summer is a very busy time of the year for me for non-ham projects!
Cal AD8Q

Jul 16
Thanks for your prompt reply, Irad but I'm running WINE under MX-Linux (Debian-based). I have no anti-virus software installed in either, unless WINE installs it by default, which I seriously doubt. Google mail could be performing an anti-virus behavior, but it seems like you would have seen the problem under Windows by now.
Best,
Cal AD8Q
Like
Jul 17
Replying to
please start a new thread with your issue and not on this one.
Please provide with a screenshot of your settings please of the Email gateway.
Please make sure the IMAP password is set correctly. the TEST is not a good indicator as there is a bug that it uses the SMTP password when doing TEST for IMAP. click the SHOW button to verify.
There is a bug where TEST in IMAP uses the password from SMTP... but when trying to access the IMAP on a normal operation it uses the right password.
Please double check again the the passwords are truly identical.
You can validate this by looking in the VarAC .ini file and see of the encrypted strings for both is identical.
73s
Irad