Here are the steps to enable IMAP on your Gmail account
Step 1: Enable IMAP
In your Gmail account (link)
Step 2: Generate An App Password For Mail:
Google 2 Step Verification have to be enabled
Please make sure you have Google 2 Step Verification On. Otherwise it's not possible to connect Gmail to Salesmachine. Once you have it On, please proceed.
On the same page, you have to define a specific password to be entered in Salesmachine.
Create Google App Passwords (link)
Choose "Mail" under the "Select app" dropdown
Set an application name: Salesmachine
You will use this password to connect on Step 3.