SMTP Sending Problem

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Harrek
Registered User
Posts: 3
Joined: Wed Dec 04, 2019 10:38 pm

SMTP Sending Problem

Post by Harrek » Wed Dec 04, 2019 10:47 pm

Final item on my install is that phpBB can't send emails. I've configured it to connect to my SMTP server on the standard port. No authentication is needed (the SMTP server is behind a firewall and only hosts behind the firewall can talk to it via SMTP, both servers are behind the firewall). From the server running phpBB I can telnet to the smtp port on the SMTP server and type in and queue an email message with no problems. So I know my phpBB server can connect to this other server via SMTP. However anytime I try to send a test email from the phpBB Email Settings page I get an error in the error log saying it can't connect to the smtp host, permission denied. I have double checked the IP address I use AND the port number as well as having authentication set to plain. But I can't seem to figure out what to try or do next given I can connect to that server over a telnet connection and queue up an email no problem.

Any pointers or additional places I can look? phpBB is running on a CentOS server. The SMTP server is Windows Server 2016 Standard

User avatar
EA117
Registered User
Posts: 1157
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: SMTP Sending Problem

Post by EA117 » Thu Dec 05, 2019 2:52 am

Are you able to show the actual error log entry? Just "xxxx" out anything that seems sensitive enough you don't want to share. But just looking for what the specific and actual error message is that phpBB ends up logging.

Harrek
Registered User
Posts: 3
Joined: Wed Dec 04, 2019 10:38 pm

Re: SMTP Sending Problem

Post by Harrek » Fri Dec 06, 2019 11:42 pm

Email error
» EMAIL/SMTP
/phpBB3/adm/index.php

Could not connect to smtp host : 13 : Permission denied

Errno 2: stream_socket_client(): unable to connect to xxx.xxx.xxx.xxx:25 (Permission denied) at [ROOT]/includes/functions_messenger.php line 1187

And I verified the IP Address that I xxx'ed out is indeed correct and the same one I am using telnet to connect to.

User avatar
EA117
Registered User
Posts: 1157
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: SMTP Sending Problem

Post by EA117 » Sat Dec 07, 2019 4:22 pm

That does seem a bit unique an unusual to be receiving a "permission" error from stream_socket_client(), as opposed to a more network connectivity-related error. It does seem like a condition you're expecting to resolve on the CentOS side rather than the SMTP server side, since it doesn't appear that connectivity has been allowed to even involve the Windows 2016 server end of things yet.

https://serverfault.com/a/415990 talks about a permission that allows the HTTPD process (which is there the PHP execution is happening, or at least on behalf of the HTTPD process) to make outgoing connections or not.

So one question that raises: Can anything in your phpBB server make an outbound connection? Maybe SMTP is just the first way in which it was noticed, but perhaps all outbound connections will fail. One test which comes to mind (simply because we've been discussing it elsewhere) is attempting a "Re-Check version" in the phpBB ACP, either for the phpBB version itself or for the version of one of the extensions.

If the outbound communication is being blocked you will get an "unable to retrieve version information"-type error, rather than a successful determination of "up to date" or determination that "a later version is available."

Harrek
Registered User
Posts: 3
Joined: Wed Dec 04, 2019 10:38 pm

Re: SMTP Sending Problem

Post by Harrek » Sat Dec 07, 2019 6:42 pm

As I said in the first post. From the phpBB server, I can use telnet to connect to the SMTP server and send an email message. So essentially:

telnet xxx.xxx.xxx.xxx 25

gets me to the SMTP server where I can then type in a session to create and send an email. And indeed the SMTP server DOES queue and send the email out no problem. So I do have connectivity to port 25 on the SMTP server this way. So it can't be a overall or CentOS problem stopping it.

User avatar
EA117
Registered User
Posts: 1157
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: SMTP Sending Problem

Post by EA117 » Sat Dec 07, 2019 7:56 pm

There was no proposal that "all communication is blocked." The issue being described in the linked discussion was of outbound connections from HTTPD not being allowed; not "the entire system." That condition, when true, wouldn't stop the telnet test from still succeeding.

Meaning in response to someone making a request to your web server (which is what's happening here), the process in your web server that handles these inbound HTTP requests in turn tried to make an outbound connection (to the SMTP server) as part of it's processing. But that a configuration of the web server or the operating system is denying these outbound connection attempts.

The test of "Re-Check version" would also perform the "during the course of handling an inbound web request, the web server will try to make an outbound connection" processing. But takes SMTP entirely out of the equation, proving whether its a fundamental issue versus "just email."

Performing the test described will be more effective way to say "No, that's not the problem." Or to prove "Yes, that seems to be the issue."

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50922
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: SMTP Sending Problem

Post by stevemaury » Sun Dec 08, 2019 2:40 pm

What happens if you set "Use SMTP" to No?
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

Post Reply

Return to “[3.2.x] Support Forum”