cancel
Showing results for 
Search instead for 
Did you mean: 

Removing sendmail from my system

Kevin Epstein
Occasional Advisor

Removing sendmail from my system

Hi All,

Does anyone have a comprehensive method of removing sendmail from an HP-UX 11.0 box? Maybe just a list of files that need removing.

Thanks.
5 REPLIES
Christopher Caldwell
Honored Contributor

Re: Removing sendmail from my system

Brute force method:
rm all of this (assumes 8.9.3)
/etc/mail/*
/etc/rc.config.d/mailservs
/sbin/init.d/sendmail
/sbin/rc1.d/K460sendmail
/sbin/rc2.d/S540sendmail
/usr/bin/mailq
/usr/newconfig/etc/mail/*
/usr/sbin/makemap
/usr/sbin/newaliases
/usr/sbin/sendmail
/usr/sbin/smrsh
/usr/sbin/smtpd
/usr/share/doc/sendmail8-8_delta.txt
/usr/share/doc/sendmail8-9_delta.txt
/usr/share/doc/sendmail8-9_release.txt
/usr/share/lib/sendmail.hf
/usr/share/lib/vacation.def

(depending on version)
rm /usr/contrib/sendmail

SD-UX method (preferred--if you use the former method, the IPD will still think sendmail is installed; future patches will add sendmail back):
#swremove
[pick your core runtime]
[pick Internet Services]
[pick runtime (INETSVCS-RUN)]
select the sendmail related items.

/etc/mail/*
/etc/rc.config.d/mailservs
/sbin/init.d/sendmail
/sbin/rc1.d/K460sendmail
/sbin/rc2.d/S540sendmail
/usr/bin/mailq
/usr/newconfig/etc/mail/*
/usr/sbin/makemap
/usr/sbin/newaliases
/usr/sbin/sendmail
/usr/sbin/smrsh
/usr/sbin/smtpd
/usr/share/doc/sendmail8-8_delta.txt
/usr/share/doc/sendmail8-9_delta.txt
/usr/share/doc/sendmail8-9_release.txt
/usr/share/lib/sendmail.hf
/usr/share/lib/vacation.def

You might consider turning it off instead.

In
/etc/rc.config.d/mailservs
Change
export SENDMAIL_SERVER=1
to
export SENDMAIL_SERVER=0
Jose Mosquera
Honored Contributor

Re: Removing sendmail from my system

Hi,

Why you need remove it?

For security reason you can block incoming emails setting "SENDMAIL_SERVER" to 0 (cero) into /etc/rc.config.d/mailservs file.

After this you must stop the sendmail service by:
/sbin/init.d/sendmail stop

When this done your box will be **deaf** for any incoming messages, however you can send emails if your service is appropriately configured. When your sendmail service is not appropriately configured, any outgoing message will be queued in /var/spool/mqueue, for each message you have two files. You could remove them if they are not interesting for you. The correct form of consulting this queue is:
#mailq -v

If in the future you need ativate the sendmail service, you must set firts "SENDMAIL_SERVER" to 1 and then start it:
#/sbin/init.d/sendmail start

After this your sendmail daemon will be listening again for incoming messages.

May this info will be useful for you.

Rgds.
Helen French
Honored Contributor

Re: Removing sendmail from my system

I wouldn't suggest removing sendmail from the system completely. Instead, you can disable sendmail services permanently from the system:

1) Edit /etc/rc.config.d/mailservs and replace the "1" with "0"
2) Move the sendmail start command from rc script directory (/sbin/init.d/sendmail) and it's links from /sbin/rcX.d.
Life is a promise, fulfill it!
Kevin Epstein
Occasional Advisor

Re: Removing sendmail from my system

OK - I like Christophers idea of using swremove to remove the various files. How could I do this from the command line?

The reason behind this, is that we want to remove the version of sendmail that ships with HP-UX and install our own which we've created into a depot. We want to make removal of the previous version part of the pre-install script of our sendmail package that we've created.
Jose Mosquera
Honored Contributor

Re: Removing sendmail from my system

Hi again,

Whenever I have updated this service in the past (personal experience) I have not needed to delete the previous version. On the contrary, I have always copied the directory "/etc/mail" to maintain the current configuration because the configuration files are updated too, losing your current configuration of parameters. Of couse, the new installed version can include improvements that can require of small configuration tuning (generally the file /etc/mail/sendmail.cf").

Rgds.