Download Mail Plugin not secure with Gmail

By Damon - January 18, 2016

Hi Greg,

I just tested a Download Mail installation I have on an external site pulling in my Gmail content and it is working with CMS Builder 3.

Do you have 2-Stpe Verification enabled for you Gmail account?

If so, you will need to generate an App password and use that:
https://security.google.com/settings/security/apppasswords

Can you let me know. Thanks.

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Hi Damon,

Thanks for the message. I am also using cmsBuilder 3.

I don't have 2-step verification enabled on my Gmail account. I am using Google Apps for Work though so perhaps this has additional security features.

Also, when I try and visit the Google link you suggested it says that this setting is not available for my account.

Thanks again,

Greg

By Damon - January 18, 2016

Hi again,

Can you copy and paste your downloadMail.php settings (line 13 - 24) here but blank out your account (email), username and password?

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Hi Damon,

Below are the lines of code you requested:

  'account'  => 'me@gmail.com', // account name, displayed in CMS
  'type'     => 'IMAP',              // account type: POP3 or IMAP
  'username' => 'me@gmail.com', // or example@yourdomain.com for Google Apps
  'password' => 'mypassword',
  'hostname' => 'imap.gmail.com',
  'archive'  => '[Gmail]/All Mail', // IMAP Only, move messages to this folder instead of deleting them
  'secure'   => true,  // whether the host requires a secure connection: true or false (no quotes)
  'port'     => '193',    // (optional) port number (if non-standard)
  'limit'    => '5',   // (optional) max messages to download at a time (set low to avoid server timeouts)
  'testmode' => true, // (optional) don't archive or erase messages after downloading them

Thanks,

Greg

Hi Greg,

I notice you've got the port set to 193, is that the port suggested by your IT admins? I think the Imap port should be 993 for gmail, or you can leave the field blank and the plugin should find the correct port automatically. 

I was able to connect via IMAP via my work gmail account using the following method:

  • On my first attempt to connect, I was sent an email from gmail with a warning. This contained a link to "Change security settings", click this. 
  • After logging in, you'll see a list of devices that accessed your account, click the back arrow next to recently used devices at the top of the page.
  • Find and Click App Passwords.
  • Create a custom app password, give it the name like "CMSB Download Mail Password" and click generate.
  • Copy the password and add it to the password variable in your downloadMail.php file. 

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

Hi Greg,

Thanks very much for the clear instructions. I will revert if I still can't get this working.

Have a great weekend!

Greg