Error while sending mail using PHP scripts
Introduction
Sometimes, PHP mail scripts may fail while sending emails through Exim due to TLS-related issues with remote SMTP servers. This issue can generate transport errors in the mail logs.
Prerequisites
- Root or SSH access to the server
- Access to the Exim configuration file
- Basic knowledge of mail server configuration
Implementation
Problem
The following error may appear while sending emails using PHP scripts:
T=remote_smtp defer (-1): smtp transport process returned non-zero status 0x000b:
terminated by signal 11
Resolution
Edit the Exim configuration file:
/etc/exim.conf
Locate the following section:
remote_smtp:
driver = smtp
Change it to:
remote_smtp:
driver = smtp
hosts_avoid_tls=*
Save the configuration file and restart Exim.
Explanation
If Exim is built with TLS support and the remote mail server advertises TLS, the SMTP transport will automatically attempt to establish a TLS session.
This behaviour can be prevented by using the option:
hosts_avoid_tls=*
This tells Exim not to use TLS for SMTP connections to remote hosts.
Conclusion
By modifying the Exim SMTP transport configuration and disabling TLS for remote SMTP connections, you can resolve PHP mail sending issues related to signal 11 and SMTP transport failures.
