XF 2.2 Email Options

Oversold

Member
Ok so i have been running around in circles trying to figure out why i cannot get my email settings right?
no matter the options i put into the email transport method section are working. keep getting errors when i test confirmation emails "Connection could not be established with host". i have tried all diffrent email services from hosted to SES.

Main Error:
  • Email to email@email.com from email@email.com failed: Connection could not be established with host email-smtp.us-east-1.amazonaws.com :stream_socket_client(): unable to connect to tcp://email-smtp.us-east-1.amazonaws.com:587 (Permission denied)
  • the "Email to" and "From" are the same? not the domain specific email i set up in amazon SES
I am at a brick wall right now... what am i doing wrong?
 
What's your hosting environment like?
Have you configured any sort of firewall that needs to be modified to permit the outgoing connection? (in this case, for port 587)
 
its hosted on a VPS running Almalinux and i have the port 587 added within firewalld
Have you tried the manual steps to troubleshoot the connection?

Ref: Troubleshoot the application's TCP connection

This will determine if your server can communicate properly at the most basic level. Based on the error "unable to connect", this would be the next step to rule out any server configuration issue.

Edit:
I tested this myself and found that on two different servers in the same DC, one works fine with the test command and the other doesn't. (other than IP address, the servers are identical in config... now I'm curious.)
 
Last edited:
its hosted on a VPS running Almalinux and i have the port 587 added within firewalld
Just a follow-up on my side, I didn't realize it at the time, but the server that couldn't connect was on a newer account where I hadn't unlocked the mail ports with the hosting service.

If you cannot resolve this on your own, get in touch with your VPS host to see if they block email ports for newer accounts.

For example, Linode has this policy in place:

Sending Email on Linode​

In an effort to fight spam, Linode restricts outbound connections on ports 25, 465, and 587 on all Linodes for new accounts created after November 5th, 2019.

If you have a need to send mail from your Linode, we ask that you first configure (1) valid DNS A records and (2) rDNS records for any Linodes that you plan to use to send mail. Then, open a Support ticket from the Linode Manager – we’ll ask you to provide the name of the Linode(s) that will be used for mailing.

Once you’ve completed those steps and provided that information, our Support team will be happy to review your request.
 
Just a follow-up on my side, I didn't realize it at the time, but the server that couldn't connect was on a newer account where I hadn't unlocked the mail ports with the hosting service.

If you cannot resolve this on your own, get in touch with your VPS host to see if they block email ports for newer accounts.

For example, Linode has this policy in place:

Yep, I just happened to come across this from linode so lets hope that this is the root of the issue and there is nothing more to it
 
All is working now!
My host opened the ports but it still was not working right so i did some tinkering with some settings

The following steps worked for me using Almalinux:

  1. Check if httpd_can_sendmail is on , run this "getsebool httpd_can_sendmail"
    • When you get: httpd_can_sendmail --> off , run "setsebool -P httpd_can_sendmail 1"
    • When you get: httpd_can_sendmail --> on that's fine move on step 2.
  2. Check also if httpd_can_network_connectis on, run "getsebool httpd_can_network_connect"
    • When you get httpd_can_network_connect --> off run "setsebool -P httpd_can_network_connect 1"
    • When you get: httpd_can_network_connect --> on you should be good to go
 
  • Like
Reactions: ENF
Top Bottom