Operating System - HP-UX
1826004 Members
3313 Online
109690 Solutions
New Discussion

Disable user to use sendmail

 
SOLVED
Go to solution
j773303
Super Advisor

Disable user to use sendmail

Is it possible to disable some user can't use sendmail for sending and receiving mail ?? Thanks.
Hero
4 REPLIES 4
Marcel Boogert_1
Trusted Contributor

Re: Disable user to use sendmail

Hi there,

Not by my knowledge, but you can try the following workaround:

you can make a file called sendmail under the users home-dir and put some text in it that the user isn't authorized. Next thing is to chown root:sys and the chmod 505 on the newly created file. Next is to make sure the users home-dir is the first search path in the $PATH variable.

MB.
Muthukumar_5
Honored Contributor
Solution

Re: Disable user to use sendmail

we are not any configuration files to allow / deny the user to access the sendmail. So we have to do programming as,

move the origial sendmail binary /usr/bin/sendmail to /usr/bin/sendmailorg

Make a script as,

#!/usr/bin/ksh

ALLOW_USER="root test user"

index=0
while [[ $index -lt ${#ALLOW_USER[*]} ]]
do

if [[ "$(who -m | awk '{ print $1 }')" != "${ALLOW_USER[$index]}" ]]
then

echo "You are not allowed to execute sendmail"
exit 1
else

echo "/usr/bin/sendmailorg $*" | sh

fi

let index=index+1
done

You can use configuration of users allow as,

/etc/mail/sendmail.allow file name

Put the name's there and read the user's from there on script too.

Easy to suggest when don't know about the problem!
Michael_356
Frequent Advisor

Re: Disable user to use sendmail

Hi there,

You can prohibit users from sending mail by adding them the the /etc/mail/access

Regards

Michael
Muthukumar_5
Honored Contributor

Re: Disable user to use sendmail

oops. Try to move the new script as /usr/bin/sendmail there so that new script will be executed instead of original sendmail binary.

new script checks user and give the access to use original binary. And more it is good to change sendmail* name on /usr/bin/ location so that other user's directly access them
Easy to suggest when don't know about the problem!