Operating System - HP-UX
1831460 Members
2862 Online
110025 Solutions
New Discussion

sendmail - prohibiting/enabling users from sending mails

 
W L Wong
Frequent Advisor

sendmail - prohibiting/enabling users from sending mails

Hi,
Running HP-UX 11.00. Would like to know how I can enable/prohibit users from sending mails (no one receives mail).

So far, I have set /var/spool/mqueue to read/write for all and this works, but I think is not a recommended way :

mlbs0039:ttyp5 /var/spool # ls -ld /var/spool/mqueue
drwxrwxrwx 2 bin bin 11264 Aug 13 11:34 /var/spool/mqueue/

If not, mail.log complains :
Aug 13 11:19:54 mlbs0039 sendmail[24530]: NOQUEUE: SYSERR(a50adm): queuename: Cannot create "qfLAA24530" in "/var/spool/mqueue
" (euid=3201): Permission denied

Strangely in my 11.11 box it works for all users even without changing the permission of mqueue (0755).

Thanks.
6 REPLIES 6
Denver Osborn
Honored Contributor

Re: sendmail - prohibiting/enabling users from sending mails

Have a look at the permissions of /usr/sbin/sendmail. The owner should be root, group mail and

ll /usr/sbin/sendmail
-r-sr-sr-t 1 root mail 856064 Nov 14 2000 /usr/sbin/sendmail


After you fix the permissions of sendmail, the users will be able to send messages and you can set /var/spool/mqueue back to 755 bin:bin

chmod 7555 /usr/sbin/sendmail

Hope this helps,
-denver
W L Wong
Frequent Advisor

Re: sendmail - prohibiting/enabling users from sending mails

Thanks Denver.

Is there a way sendmail can enable/disable other users from sending out mails? Eg by editing sendmail.cf ? Is this possible?

Steven E. Protter
Exalted Contributor

Re: sendmail - prohibiting/enabling users from sending mails

You also might want to check the permissions of the files in /var/mail

/var/mail/root is root for example.

Other helpful stuff.

mailq display the mail queue. In this case it should be empty.

sendmail -v -q verbose clear attempt on the mail queue. Tries to force the mail out.

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

username OK tab delimited for good.
usernot REJECT

or DROP for those you don't want to send and receive mail.

To build the sendmail.cf file from these macro directives, you'll need this script, which also turns on common anti spam programs.

http://www.hpux.ws/buildmail.hpux.text

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
D Block 2
Respected Contributor

Re: sendmail - prohibiting/enabling users from sending mails

if you update or change your sendmail.cf file, you can test or review by running:

sendmail -bt -C/etc/mail/sendmail.cf
=M
/quit or Ctrl-q to quit

Golf is a Good Walk Spoiled, Mark Twain.
W L Wong
Frequent Advisor

Re: sendmail - prohibiting/enabling users from sending mails

Thanks SEP - but I should have clarified this. I meant disabling Unix users (eg in the example above the Unix user a50adm) from sending mails.

Cesare Salvioni
Trusted Contributor

Re: sendmail - prohibiting/enabling users from sending mails

Hi
yep, there is a way to enable/disable specified users from sending email through sendmail.cf but it's really not simple !!

What you have to do is write a new rule in sendmail.cf which check the sender and decide if allow or deny it. There is already such a rule for relaying to specified host for example, or to perform relaying between UUCP and SMTP.
The problem is that sendmail.cf rule sintax is really cryptic, i cannot help more then this. Take a look at o'reilly manual http://www.oreilly.com/catalog/sendmail3/index.html or go to http://www.sendmail.org/

i know that is not so much but
hope it helps