How to make PHP’s mail() command work with Kerio MailServer on Linux

For Ubuntu

Look for the sendmail_path setting in the /etc/php.ini file. By default, it is set to /usr/sbin/sendmail -t -i.

You can replace the original sendmail with the Kerio version using the following commands:

sudo apt install sendmail

sudo apt install mailutils

cd /usr/sbin

mv ./sendmail ./sendmail-orig

cp /opt/kerio/mailserver/sendmail .

cp /opt/kerio/mailserver/libktssl.so.1.0.0 /usr/lib

cp /opt/kerio/mailserver/libktz.so.1 /usr/lib

cp /opt/kerio/mailserver/libktcrypto.so.1.0.0 /usr/lib

You can test by executing this command for Test email:

echo "test" | mail admin@youdomain.com

For RHEL or CentOS

# yum -y install sendmail

# yum -y install mailx

cd /usr/sbin

mv ./sendmail ./sendmail-orig

cp /opt/kerio/mailserver/sendmail .

cp /opt/kerio/mailserver/libktssl.so.1.0.0 /usr/lib

cp /opt/kerio/mailserver/libktz.so.1 /usr/lib

cp /opt/kerio/mailserver/libktcrypto.so.1.0.0 /usr/lib

/sbin/ldconfig -v

You can test by executing this command for Test email:

echo "test" | mail admin@youdomain.com