Gsuite email account - Connection refused (111)

I am using email account hosted with GSuite.
while setting up email settings. getting below error.
SuiteCRM hosted with Godaddy.

please help.

3: Connection: opening to smtp-relay.gmail.com:587, timeout=300, options=array()
3: Connection failed. Error #2: stream_socket_client(): unable to connect to smtp-relay.gmail.com:587 (Connection refused) [/home/bvngxrkq08zi/public_html/crm.soarbattery.com/vendor/phpmailer/phpmailer/src/SMTP.php line 349]
1: SMTP ERROR: Failed to connect to server: Connection refused (111)
3: SMTP connect() failed.

Hi @satishmali,

Welcome to the community :tada:

Have you set your Gmail account to allow it to use “less secure applications”. This was added in the run up to deprecation of the current system for the newer more secure method they are implementing. We are working on this improvement however for now your have to ensure that option is selected :+1:

Dear Mac,
Thank you for your response
yes, here I confirm that I send the property allow less secure apps and also added SMTP relay configuration to allow my GoDaddy hosting IP address.

SMTP.mail.com
Smtp-relay.gmail.com

I tried with both SMTP host but still it doesn’t work.
Just to keep you informed when I use IMAP I am able to to configure inbound email settings.
The problem is only with outbound email SMTP configuration.

I also try to use a normal Gmail account unfortunately it also doesn’t work.

Please suggest if any other settings I should try.

Because of this error, currently I am stuck with implementation of suiteCRM and cannot proceed further.

Ok thanks!

To confirm you tried without using the relay? with just smtp.gmail.com and port 587 using tls

I tried using TLS-587 and SSL 465 on smtp.gmail.com and smtp-relay.gmail.com

And with required authentication and No authentication both.

Error remains same.

When checked with gSuite support team, according to them connection request is not reaching upto Google SMTP server.
According to gSuite support staff, it’s some internal application problem within code or/configuration which incorrectly logging as connection refused…

Please let me know if any other inputs needed.

Thanks
Satish

Dear Mac,

This is to keep you informed that email configuration issue is resolved after changing the host to localhost (godaddy) ( Instead of smtp.gmail.com and smtp-relay.gmail.com).
and disabling smtpauth = false and smtp port 25
tls/ssl set to NONE.

Now there are another issues while saving email address.

MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘d1d4dd69-a352-6512-d661-5f1474123ccf’’ AND
** deleted = 0’ at line 6**

Wed Jul 22 06:52:20 2020 [747042][1][FATAL] SugarBean::populateDefaultValues $field_defs should be an array
Wed Jul 22 06:53:40 2020 [753882][1][FATAL] log call at: modules/EmailMan/tpls/config.tpl:465 - styleChecked is not set
Wed Jul 22 06:55:36 2020 [763208][1][FATAL] log call at: modules/EmailMan/tpls/config.tpl:465 - styleChecked is not set
Wed Jul 22 07:00:00 2020 [791406][1][FATAL] Undefined index: module
Wed Jul 22 07:00:00 2020 [791406][1][FATAL] Invalid or missing SubPanelDefinition property: subpanel_name
Wed Jul 22 07:00:00 2020 [791406][1][FATAL] Failed to load original or custom subpanel data for eapm in
Wed Jul 22 07:02:48 2020 [810684][1][FATAL] Mysqli_query failed.
Wed Jul 22 07:02:48 2020 [810684][1][FATAL] Query Failed: UPDATE email_addresses
SET
email_address = ‘rakesh@gmail.com’,
email_address_caps = ‘RAKESH@GMAIL.COM’
WHERE
id = ‘‘d1d4dd69-a352-6512-d661-5f1474123ccf’’ AND
deleted = 0: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘d1d4dd69-a352-6512-d661-5f1474123ccf’’ AND
deleted = 0’ at line 6
Wed Jul 22 07:02:48 2020 [810684][1][FATAL] Email address save error
Wed Jul 22 07:06:40 2020 [831061][78b4f67a-a408-5cf4-6c19-5f11e9ee40aa][FATAL] SugarBean::populateDefaultValues $field_defs should be an array
Wed Jul 22 07:15:36 2020 [881937][78b4f67a-a408-5cf4-6c19-5f11e9ee40aa][FATAL] Undefined index: module
Wed Jul 22 07:15:36 2020 [881937][78b4f67a-a408-5cf4-6c19-5f11e9ee40aa][FATAL] Invalid or missing SubPanelDefinition property: subpanel_name
Wed Jul 22 07:15:36 2020 [881937][78b4f67a-a408-5cf4-6c19-5f11e9ee40aa][FATAL] Failed to load original or custom subpanel data for eapm in

@satishmali thats good to hear!

May i ask what database version you are using?

  • Server: Localhost via UNIX socket
  • Server type: MySQL Server version: 5.6.47-cll-lve - MySQL Community Server (GPL)
  • Protocol version: 10

PHP version: 7.2.7

Hello all

@satishmali did you manage to resolve this? Are you creating a new “less secure app” integration?

I see from https://gsuiteupdates.googleblog.com/2019/12/less-secure-apps-oauth-google-username-password-incorrect.html that Google does not allow a new “less secure app” any longer.

That means that SuiteCRM is now no longer capable of making new connections to GMail.
@Mac-Rae, what is the ETA of the OAuth capability in SuiteCRM? Until then users will not be able to integrate with GMail.

I also see that Office365 is termination their basic authentication on 13 October in favour of OAuth2 : https://developer.microsoft.com/en-us/office/blogs/end-of-support-for-basic-authentication-access-to-exchange-online-apis-for-office-365-customers/

Dear EugeneP,

Answer to your question is Yes… I am creating a new outbound email connection using “less secure app” integration.

OAuth - I am yet to try out this option.