Operating System - HP-UX
1834133 Members
1872 Online
110064 Solutions
New Discussion

Re: Disable sendmail except MTA

 
SOLVED
Go to solution
Sean OB_1
Honored Contributor

Disable sendmail except MTA

Hello,

I'd like to setup a box so that all parts of sendmail are disabled, with the exception of the MTA so I can send mail out of the server.

Essentially I only want to be able to send email from the server and do not want to receive or relay any mail.

Does anyone have a doc that outlines the best way to do this?

TIA,

Sean
6 REPLIES 6
Donny Jekels
Respected Contributor

Re: Disable sendmail except MTA

disable sendmail. it will still send mail out to the smtp gateway.

/etc/rc.config.d/mailserv

export SENDMAIL_SERVER=0

done.

oh, kill the current sendmail running


"Vision, is the art of seeing the invisible"
Pete Randall
Outstanding Contributor

Re: Disable sendmail except MTA

Sean,

You don't need to have sendmail running to send outgoing mail. Just disable the startup!


Pete

Pete
Sridhar Bhaskarla
Honored Contributor
Solution

Re: Disable sendmail except MTA

Hi Sean,

You don't need to run 'sendmail' as a daemon to send mail out. Stop sendmail by running '/sbin/init.d/sendmail stop'. Edit /etc/rc.config.d/mailsrvs and make SEND_MAIL_SERVER=0.

Add MX records or a relay host to your sendmail.cf file (DS macro) if you have a relay to send the mail out. Sendmail will be invoked but only as a client while sending the mail out.

However, since sendmail is not running daemon mode, any failed messages will not be delivered and will be sitting in the mail queue. So, I suggest you enable your cron to run 'sendmail -q' once every 5 mins. It will take care of pending mail if any.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Jeff Schussele
Honored Contributor

Re: Disable sendmail except MTA

Hi Sean,

This is very easy.
Just

1) /sbin/init.d/sendmail stop
2) Edit /etc/rc.config.d/mailservs & set SENDMAIL_SERVER=0

Then it will never start sendmail as a daemon.
But remember that the delivery will be a "one-time" shot. So you may wish to set up a cron to periodically run
sendmail -q
to try another one-time delivery attempt.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Ray Carlson
Frequent Advisor

Re: Disable sendmail except MTA

Just one last note: I agree with everything above except that Sendmail will continue to recieve mail that is set from a local user to a local user on the machine.
Jeff Schussele
Honored Contributor

Re: Disable sendmail except MTA

Hi Ray,

Yes that's somewhat true. The local mail processors (mailx, elm, etc.) typically only fork a sendmail process to deliver the mail.
They do not use sendmail to receive mail as it's already in the user's mail file.
There's *no* way I know of to disable that as it's coded into those binaries. But again sendmail is only used for delivery.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!