Gsuite smtp Mail API error Topic is solved

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Post Reply
creaktor
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Mar 21, 2014 3:59 pm

Gsuite smtp Mail API error

Post by creaktor » Tue Jul 23, 2019 3:53 pm

I searched for over 3 hours to find the answer, but what works with most people in the past, doesn't seem to work with me.

I have a gsuite account for business domainname-X with 2 users. Me and my wife have a main google gsuite account emailaddress that ends on this domainname-X. I also added a alias as a "send as" in the gmail settings for my wife as domainname-Y.

Inside the site of domainname-Y I try to let rsformspro send mails via smtp.gmail.com. The from and reply to email address contains an domainname-Y emailaddress while the authentication uses my wifes gsuite username of domainname-X. In addition I use 2 step auth in gsuite so I had to enable less secure apps as well as creating a special app password that I copied without the spaces. For many people this works. I enabled OpenSSL extension since I run letsencrypt on linux/ direct admin on Php 7.2.19 for this user.
spf record is correct.

So I sent a test mail in the Joomla mail settings.

Mail settings:
SMTP
smtp.gmail.com
port 587 starttls
username: wife@domainname-X.com
password: google app password

I set up the debugger to include almost everything inside the everything.php log file.
This trows the following error:

Code: Select all

2019-07-23T13:07:37+00:00	ERROR xx.xxx.xx.xxx	mail	Error in Mail API: SMTP -> get_lines(): $data is "
I just spoke with Google for 2 hours as well as my hosting provider and for now since everything we did matches what should work, It seems to them there is a bug in the mail api (i'm just a messenger).
Last edited by toivo on Sun Jul 28, 2019 7:13 am, edited 1 time in total.
Reason: mod note: moved from 3.x Bug Reporting

User avatar
paulala
Joomla! Explorer
Joomla! Explorer
Posts: 301
Joined: Sat Oct 30, 2010 12:32 pm
Location: Scotland
Contact:

Re: Gsuite smtp Mail API error

Post by paulala » Thu Jul 25, 2019 9:49 am

Is this running on a VPS or a hosting account?
Warm Regards,
Paula Livingstone, Skydiving Instructor and Network Security Consultant
https://paulalivingstone.com
http://rustyice.co.uk

gws
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3835
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Gsuite smtp Mail API error

Post by gws » Thu Jul 25, 2019 10:40 am


User avatar
paulala
Joomla! Explorer
Joomla! Explorer
Posts: 301
Joined: Sat Oct 30, 2010 12:32 pm
Location: Scotland
Contact:

Re: Gsuite smtp Mail API error

Post by paulala » Thu Jul 25, 2019 10:42 am

Great link :)
Warm Regards,
Paula Livingstone, Skydiving Instructor and Network Security Consultant
https://paulalivingstone.com
http://rustyice.co.uk

creaktor
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Mar 21, 2014 3:59 pm

Re: Gsuite smtp Mail API error

Post by creaktor » Thu Jul 25, 2019 11:26 am

paulala wrote:
Thu Jul 25, 2019 9:49 am
Is this running on a VPS or a hosting account?
linux on VMWARE

creaktor
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Mar 21, 2014 3:59 pm

Re: Gsuite smtp Mail API error

Post by creaktor » Thu Jul 25, 2019 12:11 pm

paulala wrote:
Thu Jul 25, 2019 10:42 am
Great link :)
I tried that already. The error anything.php (see above) it outputs concerns me. How to discover the creator of the mail API code?

User avatar
paulala
Joomla! Explorer
Joomla! Explorer
Posts: 301
Joined: Sat Oct 30, 2010 12:32 pm
Location: Scotland
Contact:

Re: Gsuite smtp Mail API error

Post by paulala » Thu Jul 25, 2019 12:11 pm

Id be inclined to raise this as an issue on Github
Warm Regards,
Paula Livingstone, Skydiving Instructor and Network Security Consultant
https://paulalivingstone.com
http://rustyice.co.uk

creaktor
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Mar 21, 2014 3:59 pm

Re: Gsuite smtp Mail API error

Post by creaktor » Thu Jul 25, 2019 1:28 pm

paulala wrote:
Thu Jul 25, 2019 12:11 pm
Id be inclined to raise this as an issue on Github
I'll add it, thanks!

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 7505
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Gsuite smtp Mail API error

Post by sozzled » Sun Jul 28, 2019 7:25 am

https://www.kuneze.com/blog
Former member of Kunena project team
If you think I’m wrong then say “I think you're wrong.” If you say “You’re wrong!”, how do you know?

creaktor
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Mar 21, 2014 3:59 pm

Re: Gsuite smtp Mail API error

Post by creaktor » Mon Jul 29, 2019 11:32 am

sozzled wrote:
Sun Jul 28, 2019 7:25 am
This is not a bug; see https://issues.joomla.org/tracker/joomla-cms/25703
I added that post indeed and it appears to be a direct admin firewall setting issue in my case. When I disable the firewall it works. Now I'm in touch with my hostingprovider. I asked them to fix it and to make sure that the direct admin firewall configuration meet the requirements. I have no idea.

So for everyone experiencing this issue. If you did all of the below, check your server firewall. Disable it temporarily if you can to test it. Otherwise ask your provider to do it. Be warned, when disabling direct admin firewall from within direct admin itself, you can only enable it by using putty (be aware to whitelist your IP upfront otherwise you might not be able to access your server) and login with your server user and pass. To start the firewall type

Code: Select all

csf -e
.

1. You need to openssl enabled in php (ask hostingprovider)
5. Disable firewall temporarily.
3. Enable 2 step authentication for your google account here https://myaccount.google.com/signinopti ... ll-welcome (It's advised to use 2 step always)
3. Create app password here https://myaccount.google.com/apppasswords (if you don't use 2 step authentication for your google account, you can use the password that comes with the google account.)
4. Fill in the neccessary settings. Mailer : SMTP, SMTP Host smtp.gmail.com, SMTP Port: 587, SMTP Security: STARTTLS, SMTP Authentication: YES, SMTP Username: Your google account emailaddress, SMTP Password: Your APP passord in step 3.
6. Click Send TEST MAil from the joomla! global server config.
7. IF it works, enable firewall

Code: Select all

csf -e
and retest.


Post Reply

Return to “General Questions/New to Joomla! 3.x”