Skip to content

Instantly share code, notes, and snippets.

@javymarmol
Created July 11, 2019 17:39
Show Gist options
  • Save javymarmol/34ea351538ca4523d38c47940ccc94a1 to your computer and use it in GitHub Desktop.
Save javymarmol/34ea351538ca4523d38c47940ccc94a1 to your computer and use it in GitHub Desktop.
solve "Connection could not be established with host smtp"?
If your SELinux is in enforcing mode, you need to turn on httpd_can_sendmail and httpd_can_network_connect booleans.
You can verify if SELinux status is enforcing by running this command:
$ sestatus
...
Current mode: enforcing
...
Check status of httpd sendmail and network connect booleans:
$ getsebool httpd_can_sendmail httpd_can_network_connect
httpd_can_sendmail --> off
httpd_can_network_connect --> off
To enable sendmail and network connect and make changes persistant across reboots:
$ sudo setsebool -P httpd_can_sendmail 1
$ sudo setsebool -P httpd_can_network_connect 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment