I'm running CentOS7, PHP 8.0.30, postfix 2.10.1-9.el7 Sometimes emails we try to send through php mail() function are not sent and after enabling verbose logging for postfix's pickup, cleanup, qmgr, smtp we noticed nothing is being pickup.
pickup unix n - n 60 1 pickup -v
The email is lost between mail() (which call is logged in syslog) and postfix.
Sendmail is correctly defined in php.ini
sendmail_path = /usr/sbin/sendmail -t -i
Our exact same code runs perfectly on another server from the pool, but not this one server in particular. Any idea ?
Here are some troubleshooting steps -
Check Syslog for PHP Mail:
Verify sendmail_path:
sendmail_path
inphp.ini
:Compare Configurations:
Permissions:
/usr/sbin/sendmail
.Postfix Logs:
Check Mail Queue:
mailq
to inspect if mails are stuck in the queue.SELinux/AppArmor:
sendmail
execution.Firewall/Network:
Restart Services:
Test Direct Sendmail:
By systematically checking these areas, you should be able to identify and resolve the issue.
Turned out by disabling (what looks like absolutely unrelated) a grpc option, the issue stopped happening.