1

Recently, my linux servers sendmail program stopped working and every time I send an email I get this error:

Warning: mail() [function.mail]: Could not execute mail delivery program '/usr/sbin/sendmail' in /var/www/includes/Swift-4.0.6/lib/classes/Swift/Transport/SimpleMailInvoker.php on line 50

Now, I've traced through my web application and surely there is no problem there. So, the problem lies in executing sendmail. It used to work before so I'm not sure why it would stop all of a sudden, and I don't recall making any server changes either. I've also tried reinstalling sendmail, but I still get the same error.

One thing I noticed is that there is no file called sendmail in /usr/sbin/. However, there is an entire folder called sendmail in /usr/sbin/ and inside it there are executables and sendmail files there (sendmail.8, sendmail.h, and sendmail.0 files exist). Their execute permissions are also set fine. Is this something to worry about?

Any suggestions as to how to fix this problem?

Thanks in advance.

Baseer
  • 111
  • 1
  • 2
  • as mentioned in answer, please provide linux distribution and version information. (eg. debian lenny, redhat fedora core 9, etc). If you don't know how the directory /usr/sbin/sendmail was created and populated with files that shouldn't be there, then that IS a problem. – unixguy Oct 05 '10 at 04:55

1 Answers1

3

You have a bad installation somehow.

It is conventional on Unix that a program exists in /usr/sbin/sendmail$, which acts as an interface to the local MTA. This MTA is rarely sendmail nowadays, but other MTA's have a compatible program which is installed here.

sendmail.h would be part of the source code for sendmail, and sendmail.0 and sendmail.8 would be the man pages, so it looks like you've somehow got the source code for the right sendmail in /usr/sbin

You need to clean this up, and get a proper sendmail program into /usr/sbin/sendmail to fix php. Since you've not told us the distribution, nor which MTA you're actually using, no-one else can help you.

$ = Actually one or more of /usr/lib/sendmail and /usr/bin/sendmail as well as /usr/sbin/sendmail, programs will either search these paths, or have one or more hardcoded into them, or ask at installation time. It looks like your program is using /usr/sbin/sendmail. Regardless of which, the installation for the MTA will do it.

gorilla
  • 1,207
  • 9
  • 6
  • I am using Ubuntu 9.10 and sendmail 8.14.3-9ubuntu1. So yes my MTA is actually sendmail. Perhaps I can try relaying sendmail messages to another server? How would I configure that? – Baseer Oct 05 '10 at 14:43
  • Well I just uninstalled sendmail and installed postfix but that doesn't seem to work either... – Baseer Oct 05 '10 at 15:12
  • 1
    Any thoughts on what might cause this error to occur *occasionally*? Our system sends thousands of emails daily, but only gives this error a dozen or so times a day. :P – rinogo Oct 15 '15 at 19:00
  • I also received such error only on some emails. others where sent with no problem. – Atara Jan 07 '16 at 10:29
  • I'm also getting this problem occasionally. When it happens, any other mail() call fails with the same error. I'm using nginx with php-fpm 7.0 on Ubuntu 16.04 with direct mail() call. Restarting php-fpm temp. fixes the issue, but I'm looking for a cause + long-term solution. – Dr. Gianluigi Zane Zanettini Sep 13 '16 at 08:33