Page 1 of 1

How to run CSF while not running mail server

Posted: 25 Jul 2016, 10:02
by tuxg
Hi,

In one of the servers that we manage, we don't want to run any mail server. When we setup CSF and start it, lfd is stopping soon after it has been started. We removed SENDMAIL path line from csf.conf and restarted csf. Still lfd wouldn't run.

------------------------------------ lfd.log entries --------------------------
Jul 25 00:00:02 localhost lfd[38846]: Unable to send SENDMAIL alert via []: No such file or directory at /usr/sbin/lfd line 3725.

Jul 25 00:00:02 localhost lfd[38846]: daemon stopped
Jul 25 00:00:07 localhost lfd[38837]: *Error* pid mismatch or missing, at line 907
Jul 25 00:00:07 localhost lfd[38837]: daemon stopped
---------------------------------------------------------------------------------

[root@localhost ~]# grep ^SMTP /etc/csf/csf.conf
SMTP_BLOCK = "0"
SMTP_ALLOWLOCAL = "0"
SMTP_REDIRECT = "0"
SMTP_PORTS = "25,465,587"
SMTP_ALLOWUSER = ""
SMTP_ALLOWGROUP = "mail,mailman"
SMTPAUTH_RESTRICT = "0"
SMTPAUTH_LOG = "/var/log/secure"

This is a CentOS 7 server with Plesk control panel on it. We would like to know how to run lfd even if we don't run a mail server (as we don't need any mail alerts).

Thank you

Re: How to run CSF while not running mail server

Posted: 26 Jul 2016, 06:50
by Sergio
Have you turned off "LF_EMAIL_ALERT" inside CSF configuration?

Re: How to run CSF while not running mail server

Posted: 26 Jul 2016, 08:27
by tuxg
We have now disabled LF_EMAIL_ALERT and tried. Still same error, when csf -r is run:

*WARNING* Binary location for [SENDMAIL] [] in /etc/csf/csf.conf is either incorrect, is not installed or is not executable
*WARNING* Missing or incorrect binary locations will break csf and lfd functionality

And lfd.log shows:

Jul 26 07:42:27 localhost lfd[63438]: Unable to send SENDMAIL alert via []: No such file or directory at /usr/sbin/lfd line 3725.

Jul 26 07:42:27 localhost lfd[63438]: daemon stopped

Re: How to run CSF while not running mail server

Posted: 26 Jul 2016, 08:44
by ForumAdmin
The simplest way would be to create a dummy /usr/sbin/sendmail script, e.g:

Code: Select all

echo '#!/bin/sh' > /usr/sbin/sendmail
chmod +x /usr/sbin/sendmail

Re: How to run CSF while not running mail server

Posted: 26 Jul 2016, 08:54
by tuxg
This hasn't helped either.

Re: How to run CSF while not running mail server

Posted: 26 Jul 2016, 08:58
by ForumAdmin
If it is still the same error that that suggests that you have not disabled all the ALERT settings in csf.conf (there are quite a few). There is a profile that you can use to do so.

Re: How to run CSF while not running mail server

Posted: 26 Jul 2016, 09:54
by tuxg
Creating a dummy /usr/sbin/sendmail as suggested above and disabling the alerts as per disable_alerts profile settings has got it working.

Thanks a lot for your help.