If encountering issues when using GMAIL as your IMAP server, check the following:
- Check that you have IMAP Access turned on in your GMAIL settings (https://support.google.com/mail/answer/7126229)
- Check that your account has "Allow Less Secure Apps" turned on (https://myaccount.google.com/lesssecureapps)
Apache 2.0