Page 1 of 1

Sendmail is not starting anymore

Posted: Sun Jun 22, 2008 5:09 am
by BerArt
On one of our servers (CentOS5/Plesk8.4/ASL2/Sendmail 8.13.8-2.el5) senmail is not starting anymore after the last update to ASL 2.0 this is the message I receive when trying to start Sendmail:

Failed to start sendmail :
Starting sendmail: sendmail: usage: sendmail [ -t ] [ -fsender ] [ -Fname ] [ -bp ] [ -bs ] [ arg ... ]
[FAILED]
Starting sm-client: sendmail: illegal option -- L
sendmail: usage: sendmail [ -t ] [ -fsender ] [ -Fname ] [ -bp ] [ -bs ] [ arg ... ]
[FAILED]

Does someone know what is going wrong, or how to find out what is going wrong?

Posted: Sun Jun 22, 2008 5:35 pm
by breun
You don't need sendmail on a Plesk box. Plesk uses qmail.

Posted: Mon Jun 23, 2008 2:37 am
by BerArt
I know but PHP uses sendmail (relay is off on Qmail) so the PHP scripts cannot send mail now...

Posted: Mon Jun 23, 2008 3:06 am
by breun
So you have 2 SMTP servers running?

Posted: Mon Jun 23, 2008 3:24 am
by BerArt
I am not sure what you mean, this server is form a customer that is trying to send mail via a php scripts and this is not working,

<?php// Your email address$email = "you@example.com";// The subject$subject = "Enter your subject here";// The message$message = "Enter your message here";mail($email, $subject, $message, "From: $email");echo "The email has been sent.";?>

He thought that it had something to do with Sendmail because Qmail is running fine, but Sendmail is not running at the moment. If I read your reaction, sendmail should not be running? I am a bit lost now…

And it all worked before according to my customer...

Posted: Mon Jun 23, 2008 4:42 am
by breun
On a normal Plesk installation sendmail should not be running. It shouldn't even be installed.

Posted: Mon Jun 23, 2008 4:44 am
by BerArt
Ok, Thx! :) one step further...

Posted: Tue Jun 24, 2008 5:13 pm
by faris
There's a bit more to it.

I'm afraid I don't have the details to hand, but what should happen when Plesk is installed is that sendmail (the binary - the program) get disabled and then a symbolic (soft) link gets placed somewhere linking to a special file in the /var/qmail directory somewhere.

Then, when a PHP (or other) script wants to use sendmail, it works just as it would if sendmail itself was still there and running. You still point scripts to sendmail but qmail sort of "fakes" it.

People who know this stuff off by heart will be cringing at my poor explanation but that's basically the way it works anyway :-)

Faris.

Posted: Tue Jun 24, 2008 5:24 pm
by breun
I believe all MTA's (qmail, postfix, etc.) provide this kind of sendmail interface.

It works like this: /usr/sbin/sendmail is a symlink to /etc/alternatives/mta:
# ll /usr/sbin/sendmail
lrwxrwxrwx 1 root root 21 Nov 27 2007 /usr/sbin/sendmail -> /etc/alternatives/mta
And the alternatives system makes sure qmail's sendmail interface is used:
# ll /etc/alternatives/mta
lrwxrwxrwx 1 root root 23 May 9 00:55 /etc/alternatives/mta -> /var/qmail/bin/sendmail
So, you don't need to have the sendmail *package* installed in order to be able to use /usr/sbin/sendmail, you just need an MTA that provides a sendmail interface.