Operating System - Linux
1752590 Members
2865 Online
108788 Solutions
New Discussion юеВ

turn off linux sendmail daemon

 
SOLVED
Go to solution
Rick Garland
Honored Contributor

turn off linux sendmail daemon

Hi all:

Working with RH 3.0EL.
Working on shutting off various services & daemons. One is the sendmail process.

Example, on HPUX you can have sendmail daemon turned off and email will still be delivered from the system. Receiving email is not allowed with sendmail daemon is off.

Want the same on Linux. What I get is the maillog is;
stat=Deferred: Connection refused by [127.0.0.1]

I would like to have the sendmail daemon turned off and deliver email.
10 REPLIES 10
Ralf Hildebrandt
Valued Contributor

Re: turn off linux sendmail daemon

It seems that your sendmail is configured to pass the mail to some other program on localhost. Maybe amavis?

You could also simply bind sendmail only to localhost.
Postfix/BIND/Security/IDS/Scanner, you name it...
Geoff Wild
Honored Contributor

Re: turn off linux sendmail daemon

so, after a service sendmail stop - you can't send outgoing?

You could try setting the DS macro in the sendmail file - pointing to your mail server.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Rick Garland
Honored Contributor

Re: turn off linux sendmail daemon

Tried setting DS macro. Started sendmail so the config would be re-read. Send out mail fine.

Turn off sendmail (service sendmail stop) and the email does not go out. The maillog says "Deferred: Connection refused by 127.0.0.1"

What is missing?


Rick Garland
Honored Contributor

Re: turn off linux sendmail daemon

Some addition info;

Once you hit the . (dot) key to send the mail, it acts like it is gone. The mailq command will show there is no mail.

Start the sendmail service and the message will be delivered. With the subject and body intact.
Steven E. Protter
Exalted Contributor

Re: turn off linux sendmail daemon

Shalom Rick,

The sendmail daemon handles the inbound mail. The daemon has to be running to handle inbound smtp traffic.

The server will still be able to send mail using the sendmail binary.

In order to disable this feature, you will need to rename or disable the binary.

This will cause problems, because on Linux root cron delivers mail to root.

To get a connection refused on localhost, modify the /etc/mail/access

file and go for REJECT instead of relay.

At this point, the system will not be able to email itself.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Thorsteinson
Honored Contributor

Re: turn off linux sendmail daemon

Run chkconfig to remove the sendmail entries
from the rc?.d directtories. This will
prevent it from starting.

You will want to add crontab entry to run the
sendmail queue processing proces.

Sendmail is can be quite difficult to
configure. I use exim which provides
the same functionality with much simpler
configuration.

There are a couple of simple sendmail
replacements that will process local mail
and forward it off to a mail hub.
This may be more what you want.

Check the Debian security documentation.
Ivan Ferreira
Honored Contributor
Solution

Re: turn off linux sendmail daemon

By default, sendmail in red hat linux won't accept mail from outside and won't bind to any network interfaces, except 127.0.0.1. So, you can have it running and no one will be able to connect to the server port except the localhost.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ermin Borovac
Honored Contributor

Re: turn off linux sendmail daemon

For outgoing mail you will need to modify /etc/mail/submit.cf (or submit.mc).

Last line in /etc/mail/submit.mc says

FEATURE(`msp', `[127.0.0.1]')dnl

Change it to

FEATURE(`msp', `[]')

Then run

# m4 /etc/mail/submit.mc > /etc/mail/submit.cf

Now you can shutdown sendmail and still send email outside.

To check outgoing email queue run

# mailq -Ac
Indrajit_1
Valued Contributor

Re: turn off linux sendmail daemon

Hi;

To turn off linux sendmail daemon, u just need to type the following commands..

#service sendmail stop

u can also edit the sendmail.cf file and comment the line start with "DSxxx.com". Then type..
#service sendmail restart

u can also configured firewall to disable sendmail..
#iptables -A INPUT -P TCP --dport 25 -J DENY
#iptables -A OUTPUT -P TCP --dport 25 -J DENY

it should help u to resolve ur issue..

Cheers
indrajit
Never Ever Give Up