Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2018-07-17 10:50:53

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Trouble with contact us email setup

I am having trouble with the email setup for contact us page.

I have setup the email configuration with the same settings I use for my email. But, when  try to send a test contact us request I get the following error:

Something went wrong
file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in URLHelper.php on line 424

Any suggestions?

Offline

#2 2018-07-17 12:07:19

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Trouble with contact us email setup

What settings are you using? Usually, the “Mail” option is the best.
Have you seen the documentation?

http://backlight.theturninggate.net/doc … mail_setup


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2018-07-17 13:23:14

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Trouble with contact us email setup

I've tried both mail and smtp.

Yes, I've read the linked documentation and my setup currently matches the recommendation.

Any other suggestions as to what I can try? Is there a server config in PHP that I need to make?

Last edited by gkar47 (2018-07-18 04:03:38)

Offline

#4 2018-07-19 08:29:54

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Trouble with contact us email setup

Is there any way to get more of the error trace or error information when an error occurs? I'm trying various things to see if I can figure out what the system error is when I try to send an email for the contact page. When I use the "Send Test Email" function in the admin I get the following error and would like to get more info.

fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in SMTP.php on line 125

I selected Yes for the "Show Debug Messages", but I didn't get any more info.

Offline

#5 2018-07-19 09:02:02

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Trouble with contact us email setup

My suggestion is to send Ben (one of the developers) an email referencing this thread. Include Backlight Admin credentials. He may also need FTP access
http://community.theturninggate.net/profile.php?id=101


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#6 2018-07-19 19:43:40

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Trouble with contact us email setup

Hi Bill, that looks like your server is unable to connect to the Internet.  The line of code is called with an attempt to contact Google to verify the contact form recaptcha.  That URL starts with https://www.google.com/recaptcha/api/siteverify (and includes parameters specific to the account associated with your recaptcha and the current request).

Can you ping google.com on the command line of the server?  Can you connect to 443?  (curl https://google.com should make a good test).
If not, you'll need to fix your server's network settings to allow this.  If you can connect on the command line, another potential blocker is selinux.  If so, you'll need to allow your web server to make contact to the Internet.  Another potential blocker is any iptables or other firewall that may be blocking outgoing requests from your server.

Offline

#7 2018-07-20 04:39:28

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Trouble with contact us email setup

I've checked and I can get out on ping and curl commands you suggested. The recaptcha also seems to work fine in that it accepts the verify and gives me a check mark.

I think it may be how I have the sendmail configured on my machine. I have never used it to send mail outside this server. I have only ever used it for local mail on the server. I can send to local users and can connect to it for those emails from other boxes on my network.

If this helps any I have displayed an entry in the journal on my attempt to send email from the admin test page:

Jul 19 12:57:36 sheridan.elliot.dhs.org sendmail[760]: w6IMZFGx010229: to=<bill@billelliot.ca>, ctladdr=<bill@sheridan.elliot.dhs.org> (1000/1000), delay=20:22:21, xdelay=00:02:00, mailer=esmtp, pri=2100323, relay=mx.easymail.ca. [64.68.200.59], dsn=4.0.0, stat=Deferred: Connection timed out with mx.easymail.ca.

Offline

#8 2018-07-20 07:08:16

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Trouble with contact us email setup

The error is as stated.  The server is not able to contact Google to confirm the recaptcha, after clicking submit.  That error line is only reached in the codebase from the attempt to contact Google for recaptcha.  You may get the tick from clicking the recaptcha but that is not the end of the recaptcha mechanism.  The proof of the pudding would be to create a simple test php page called from your browser (so that it's via your web server and not command line) and see what results when attempting to run this line:

$output = file_get_contents('https://www.google.com/recaptcha/api/siteverify');

The expected result from that call is a response like:

{
"success": false,
"error-codes": [
"missing-input-response",
"missing-input-secret"
]
}

It sounds like sending email is another issue you need to solve.

Offline

#9 2018-07-20 07:13:30

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Trouble with contact us email setup

The method to contact Google first tries to use curl, if it's installed on your server, and then attempts to use file_get_contents.  Backlight expects false to be returned from those attempts.  While curl behaves nicely and returns false on being unable to call the URL, file_get_contents throws an exception.  I've modified my working code to catch the exception and return false, so that the Backlight will instead return the (slightly more) friendly message "Unable to contact reCAPTCHA service", along with continuing to show the contact form.

Offline

#10 2018-07-20 08:18:28

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Trouble with contact us email setup

I'm still working on the email issue.

But, I tried your suggestion on creating a dummy php page to just run the file_get_contents and the output is an empty string. There is no output.

But, if I use curl at the command line I get the response you expect.

I also added the php-curl package and tried the code in URLHelper that is used and got the same empty string response.

Very strange.

Offline

#11 2018-07-20 08:37:57

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Trouble with contact us email setup

Are there any errors in your Nginx error logs?  Are you running selinux, which may disallow a web server from making server requests?

Offline

#12 2018-07-20 09:00:03

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Trouble with contact us email setup

I'm not running selinux. I am running msec and have checked there and there is nothing there preventing access to the internet for any program.

I can't find anything in any of the log files for nginx or php-fpm that would indicate a problem.

Offline

#13 2018-08-02 11:59:04

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Trouble with contact us email setup

I found I did have some errors in my mail and dns setups. These have been corrected and everything is now working correctly. So I have still having problems with the admin send test email. I created a test page to add error handling around the calls to mail->send and have found it is throwing the following error:

Exception: Function split() is deprecated

Any idea has to how to correct this problem?

Offline

Board footer

Powered by FluxBB