Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug mail API #25703

Closed
Alexander-van-aken opened this issue Jul 25, 2019 · 11 comments
Closed

Possible bug mail API #25703

Alexander-van-aken opened this issue Jul 25, 2019 · 11 comments

Comments

@Alexander-van-aken
Copy link

Alexander-van-aken commented Jul 25, 2019

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:

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).

This is the original Joomla! forum post https://forum.joomla.org/viewtopic.php?f=728&t=973261&p=3575396#p3575396

@ghost
Copy link

ghost commented Jul 25, 2019

You got this on a clean Core-install too (no 3rd Party-Plugins, default-Template, …)?

@mbabker
Copy link
Contributor

mbabker commented Jul 25, 2019

It's not an error, the logger is just hardcoded to the error level with the "Error in Mail API" message prefix because the logging callback was originally set up only logging errors and wasn't updated to reflect it can also handle debug messages.

TL;DR, it's coming from this line and at that point the data variable is empty. Not an error.

If that line in your log file is your only "issue", this can be closed. Otherwise, more detail is needed to work out whatever problem it is you're having.

@Alexander-van-aken
Copy link
Author

You got this on a clean Core-install too (no 3rd Party-Plugins, default-Template, …)?
Doesn't work on clean install too.

@Alexander-van-aken
Copy link
Author

Alexander-van-aken commented Jul 25, 2019

It's not an error, the logger is just hardcoded to the error level with the "Error in Mail API" message prefix because the logging callback was originally set up only logging errors and wasn't updated to reflect it can also handle debug messages.

TL;DR, it's coming from this line and at that point the data variable is empty. Not an error.

If that line in your log file is your only "issue", this can be closed. Otherwise, more detail is needed to work out whatever problem it is you're having.

I followed this guide https://docs.joomla.org/How_do_I_use_Gmail_as_my_mail_server%3F and did all neccessary requirements like app password with no spaces, using the gsuite username emailadres.

587, starttls, smtp.gmail.com etc.

The only concern I see but I dont know technically if that is the case, is that I authenticate with a username over smtp on a different domainname. Now I spoke to google a few times in the last days and checked every setting including whitelisting etc, for that domain for the gsuite main domainname. I also tried all other combinations like port 25 and 465 over ssl. I added letsencrypt on vmware linux and inside joomla ssl is on and running no errors. php opensll is on. the domain is active as well inside the admin domain enviroment. spf is ok as well.

@mbabker
Copy link
Contributor

mbabker commented Jul 25, 2019

Still not following what your issue is. There is a reason there is an issue template with some basic questions. Right now all I am getting out of this issue and the forum thread is "I have a line in the log file that says something was an error". You have not explained what is misbehaving or what the desired end result you are looking for is, or even what it is you're trying to do outside of set up email to be sent with some Google account (which is inferred based on the config snippet and link you've given).

@Alexander-van-aken
Copy link
Author

Hi, Sorry, I am not a programmer and I have a hard time telling the right things and skipp the unimportant stuff due to knowledge gap.

I'll try to record a video these days with every required step that is advised to setup outgoing email for gsuite business. If any of you can are capable of just logging in into a gsuite business account, create the app password and setup two step and use the required settings for gmail in the joomla settings, and it works, I would not know why it is that mine is not working even though I added every requirement. php opensll is enabled, ssl letsencrypt is valid, spf is correct, all of that is just like everyone tells me it should be but whatever I do, it just does not authenticate. I asked my provider to run through the steps in this doc. If that does not help, I quit :) https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

@tonypartridge
Copy link
Contributor

Note port 587 is blocked on a lot of hosts for outgoing connections, also make sure RSForms from mail is set to use global mail address.

To use Joomla! And Gmail suits or normal you also need to enable less secure apps within that google account if I remember correctly.

@Alexander-van-aken
Copy link
Author

Note port 587 is blocked on a lot of hosts for outgoing connections, also make sure RSForms from mail is set to use global mail address.

To use Joomla! And Gmail suits or normal you also need to enable less secure apps within that google account if I remember correctly.

Hi Tony :), I am going to ask my host about port 587. They probably are aware of that since they were checking why it didn't work too.
Enable less secure apps is something that seems to can't be set when using two step autentication. Therefor they advise to use an app password (we need to use that password inside joomla's global mail config password field). I use {global:mailfrom}. However, to test if the connection is working, I use the global configuration > server "send testmail" button (so this shouldn't matter).

I shouldn't add a relay service in gsuite right? I mean, my server doesn't relay to any other IP other then google's IP? OR does dns IP have to be added in spf as well?

@Alexander-van-aken
Copy link
Author

I found the sollution. IT seems it is my firewall, when I disable it, it works. Now I will try to see why since port 587 and 465 are both enabled. Maybe only 587 should be on?

Anyway, thanks and sorry for making it a bug report while it is my own lack of knowledge.

@joomla-cms-bot
Copy link

Set to "closed" on behalf of @alikon by The JTracker Application at issues.joomla.org/joomla-cms/25703

@alikon
Copy link
Contributor

alikon commented Jul 26, 2019

happy you solved, maybe helpfull for others too


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25703.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants