IMAP should be enabled for the source domain, before migrating data from Gmail to S3 bucket using GMAILOAUTH service.


Follow the steps mentioned here to enable the IMAP access for your organization.