Here are some tips if you are having trouble getting GMail to work with SugarCRM. This was tested against SugarCRM 184.108.40.206, but will also apply to earlier versions and SuiteCRM.
1 IMAP Account Access
Make sure you have IMAP enabled for the GMail account. This settings is within GMail.
3 Allow Less Secure Clients
SugarCRM will not be able to connect unless you lower security requirements in your Google Account. This setting is in Google “My Account” Settings under Sign-in & Security.
3 Testing via Console
If you need a raw test, test the IMAP connection from the console:
openssl s_client -crlf -connect imap.gmail.com:993 ... server output ... tag login <email_address> <password> ... server output ... tag LOGOUT
Here is a great article explaining the steps in more detail.
Further Troubleshooting Inbound Email Scheduler
So all the above is correct. You can successfully connect in SugarCRM but the inbound email scheduler just does not work….
Check your sugarcrm.log file. You might see an error like this.
Tue Aug 2 11:49:11 2016 [FATAL] SCHEDULERS: could not get an IMAP connection resource for ID [ e7b9549a-4983-ab2a-3126-579fef69ebd9 ]. Skipping mailbox [ Sugar Email ].
Check the PHP Version
The SugarCRM scheduler is initiated via CRON using PHP via the CLI.
Try running the cron manually. Eg:
$ cd <your_sugar_installation> $ php -f cron.php
Now check sugarcrm.log and within SugarCRM itself. Did inbound emails get processed?
If they did great – we can process via the commandline, but CRON is not…. perhaps there are several PHP versions on the server and the CRON job is not using the correct one? I spend a long time scratching my head over this one.
I updated my crontab to look like this, putting the full path to PHP.
* * * * * cd <sugar_installation>; /usr/local/5.5.38/bin/php -f cron.php > /dev/null 2>&1
Special Characters in your GMail Password
Still no luck? This is a sneaky one that I found. Make sure your GMail account password DOES NOT have special characters (like %^$@, etc…) in it.
I found that with special characters in the password:
- You can login via GMail
- Within SugarCRM tests succeed
- Within SugarCRM the email client works
- BUT the CRON/Scheduler processing of inbound emails will fail!
So, use a good strong password but avoid special characters.