The problem could be that your Gmail account has IMAP disabled for the “All Mail” label or that IMAP is disabled. So this is how to troubleshoot this error:

  1. Log into your Gmail account at https://mail.google.com.
  2. Go to your Gmail settings and select “Forwarding and POP/IMAP” (the direct link should be https://mail.google.com/mail/u/0/#settings/fwdandpop).Please verify the following:
  • “Enable IMAP” should be selected.
  • “Do not limit the number of messages in an IMAP folder” should be selected.Gmail IMAP
  • Save the above settings.
  • Go to the “Labels” tab (the direct link should be: https://mail.google.com/mail/u/0/#settings/labels).
  • Verify that “All Mail” have “Show in IMAP” enabled.
    Settings_-_senad_dizdar_cloudhq_net_-_cloudHQ_Mail