Score:0

Could not execute: /usr/sbin/sendmail fails to send emails via PHP

cn flag

I have a strange error in my Centos 7.9 Server running with Postfix as the Sendmailer program, It has a Website running in PHP-7.4

I get the below error Once in a while (not everyday but weekly or so)

Could not execute: /usr/sbin/sendmail

To fix the issue all i have to do is to restart the php-fpm service,

 service php-fpm restart

Does anyone has any idea on why this is happening? And any known fixes to this issues.

Note: I did my research before this, most people saying it's a permission issue, but it's not true in my case as the simple restart of the php-fpm service seems to have fix it. Also we don't use any third party packages like phpmailer to send emails.

No SELinux interference as well, as SELinux runs on permissive mode.

UPDATE: This looks like memory leak in the php-fpm process, when i looked at the process it consumed 1.4GB and keep on increasing, I suspect it eventually crash the system, when try to send emails.

Ginnungagap avatar
gu flag
This will be a pain to solve without proper logging of the underlying error that prevents `sendmail` from being run...
mahen3d avatar
cn flag
@Ginnungagap what other log information you need? this is all i could find, do you have any idea on which log file i need to look into?
in flag
Probably a resource limit problem, given that the process is leaking. Check the system logs, but it would be nice if the PHP script would log why it couldn't run sendmail, no just the fact that it failed.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.