This was never an actual issue, i was being stupid, disregard this and see my last comment for details.
When sending SMTP mail it fails with the following error when using port 587 and the same when using port 465
Could not connect to smtp host : 111 : Connection refused
Errno 2: stream_socket_client(): Unable to connect to [hostname removed]:587 (Connection refused) at [ROOT]/includes/functions_messenger.php line 1193
From my testing i have determined that there is a conflict (possibly do to with phpbb using sockets for SMTP) between WHM tweak settings SMTP restrictions feature when enabled OR the configserver CSF SMTP_BLOCK enabled setting.
The WHM tweak setting SMTP restriction will not function when running CSF as per the instruction in CSF
quote
"This option in WHM will not function when running csf. You should disable WHM > Security Center > SMTP Restrictions and use the csf configuration option SMTP_BLOCK instead"
endquote
However the SMTP_BLOCK in CSF will block phpbb from sending SMTP mails i believe due to the usage of sockets by phpbb. And the same with using WHM SMTP restriction.
This leaves the server at a security risk of spammers sending emails via common ports and bypassing SMTP security because both security features have to be disabled for SMTP to work.
Article:
The issue is that the only way to get SMTP to function in phpbb is to disable both the WHM native setting in tweak settings and also disable SMTP_BLOCK in CSF. This makes the server vunerable to spammers.
I tested my site with the 3.3.12 and 3.3.14 includes/functions_messenger.php file and the result was the same, fail. So i am assuming that 3.3.13 file also does not work.
We must be able to secure the SMTP or spammers will have a field day.