Errors: Mails through XAMPP, Postfix

For: CentOs 6.9 x86_x64, XAMPP, Postfix, mail relay server

Ever got into the situation where you install XAMPP on a Linux server and realize that the mails you send through your PHP application don’t get delivered ?

  • Check /var/log/mailog for any errors.
  • Verify using telnet if the SMTP connection works.
  • Try the following command and check if the mail is delivered.
    echo "My message" | mail -s subject
  • Check /etc/postfix/
    relayhost = mail-relay-IP

    Flush postfix mail queue:

    postfix -f
  • Check if SELinux is allowing SMTP connections
    [root@webserver ~]# sestatus -b | grep sendmail
    httpd_can_sendmail                   off

    If httpd_can_sendmail is set to ‘off’ like above then do the following

    setsebool httpd_can_sendmail=1
    service postfix restart

    Then restart Apache.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s