Operating System - HP-UX
1833802 Members
2550 Online
110063 Solutions
New Discussion

Re: How to disable mail for users

 
Brian West
New Member

How to disable mail for users

We have HP-UX 10.20 with users running an application without having direct access to the shell and mail.

My question is, how to disable mail for all users on the localhost and would it be safe to just delete all the files under /var/mail for all users except root, without causing any problems or error messages.

Thanks,

Elias
3 REPLIES 3
Stefan Farrelly
Honored Contributor

Re: How to disable mail for users


Yes, its fine do delete all the mail files in /var/mail, and to disable mail simply stop the sendmail daemon running.
Set> export SENDMAIL_SERVER=0 in /etc/rc.config.d/mailservs
then do> /sbin/init.d/sendmail stop

Im from Palmerston North, New Zealand, but somehow ended up in London...
Brian West
New Member

Re: How to disable mail for users

I want to disable mail for all users except root.
Stefan Farrelly
Honored Contributor

Re: How to disable mail for users


Well, so much for stopping sendmail then. You need to leave it running.

Only 2 ways to reroute mail for all users except root;
1. in each users home dir create a .forward file which forwards their mail to someone else, eg root, or to nobody (which is setup in the /etc/mail/aliases file as /dev/null)
2. List every user in the /etc/mail/aliases file and point them to nobody, eg. user1,user2,user3.... : nobody (which reroutes to /dev/null) Then do a newaliases command.
Im from Palmerston North, New Zealand, but somehow ended up in London...