Operating System - HP-UX
1834441 Members
2504 Online
110067 Solutions
New Discussion

sendmail alias permission error

 
SOLVED
Go to solution
Alan Meyer_4
Respected Contributor

sendmail alias permission error

when I start sendmail via /sbin/init.d/sendmail start, I get the following error

newaliases: cannot open /etc/mail/aliases: Permission denied

I am executing this as root and the permissions on the files in /etc/mail are as follows:

-rw-r----- 1 root bin 880 Jun 2 09:37 aliases
-rw-r----- 1 root bin 24576 Jun 6 2004 aliases.db
-r--r--r-- 1 bin bin 10222 Nov 14 2000 mailcap
-r--r--r-- 1 bin bin 94286 Apr 1 2003 sendmail.cf
-r--r--r-- 1 bin bin 747 Jul 12 2003 sendmail.cw
-rw------- 1 root mail 34 Jun 2 10:01 sendmail.pid
-r--r--r-- 1 bin bin 1012 Nov 14 2000 service.switch


help~

Thanks,
-Alan
" I may not be certified, but I am certifiable... "
20 REPLIES 20
Pete Randall
Outstanding Contributor

Re: sendmail alias permission error

Alan,

I believe aliases needs to be -r--r--r-- .


Pete

Pete
Pete Randall
Outstanding Contributor

Re: sendmail alias permission error

as does aliases.db

Pete

Pete
Alan Meyer_4
Respected Contributor

Re: sendmail alias permission error

with the aliases files at 444 I get the following:

warning: /etc/mail/aliases has world read or write permission. This is unsafe.
warning: /etc/mail/aliases.db has world read or write permission. This is unsafe.
hash map "Alias0": unsafe map file /etc/mail/aliases.db: Permission denied
dbm map "Alias0": unsafe map file /etc/mail/aliases: Permission denied
WARNING: cannot open alias database /etc/mail/aliases
Cannot create database for alias file /etc/mail/aliases
" I may not be certified, but I am certifiable... "
Marvin Strong
Honored Contributor

Re: sendmail alias permission error

/etc/mail/aliases and aliases.db should be 640

/etc/mail should be 555 what are its permissions?
Alan Meyer_4
Respected Contributor

Re: sendmail alias permission error

aliases are back to 640 and /etc/mail has been at 555. Which is what they were set at when this all began.
" I may not be certified, but I am certifiable... "
Rick Garland
Honored Contributor

Re: sendmail alias permission error

Check the permissions from the root on down through the mail directory - make sure the root is not world write.


/ drwxr-xr-x
/etc drwxr-xr-x
/etc/mail drwxr-xr-x
Marvin Strong
Honored Contributor

Re: sendmail alias permission error


Can you run newaliases as root from a command line without an error?

Not the init script just the newaliases command.


Alan Meyer_4
Respected Contributor

Re: sendmail alias permission error

No, the newaliases command results in the same error.
" I may not be certified, but I am certifiable... "
Alan Meyer_4
Respected Contributor

Re: sendmail alias permission error

the permissions are set correct.y all the way up
" I may not be certified, but I am certifiable... "
Jeff Schussele
Honored Contributor

Re: sendmail alias permission error

Hi Alan,

What are the ownerships? should be:

/ root root
/etc bin bin
/etc/mail bin bin
/etc/mail/aliases root bin
/etc/mail/aliases.db root mail

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Alan Meyer_4
Respected Contributor

Re: sendmail alias permission error

all the protections and ownership are as specified with no change in the results.
" I may not be certified, but I am certifiable... "
Rick Garland
Honored Contributor

Re: sendmail alias permission error

View the sendmail.cf file. In the file you will see the line that indicates where the aliases file is located. Is this saying /etc/mail/aliases? Does it say something else?
Alan Meyer_4
Respected Contributor

Re: sendmail alias permission error

here's the entry in the sendmail.cf file

O AliasFile=/etc/mail/aliases

" I may not be certified, but I am certifiable... "
Jeff Schussele
Honored Contributor

Re: sendmail alias permission error

Hi (again) Alan,

OK - I'm now convinced the problem is the sendmail binary itself. newaliases is simply a link to /usr/sbin/sendmail. So what's perms/ownership on it? Should be:

-r-sr-sr-t root mail

Then run what on it & make sure the version it returns matches the version listed in the sendmail.cf file - it's the DZ value.

HTH,
Jeff

PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Alan Meyer_4
Respected Contributor

Re: sendmail alias permission error

the protections and ownership seem ok on the sendmail file. What tells me that the version is 8.11.1, the DZ value is 8.9.3

Where do I go from here?
" I may not be certified, but I am certifiable... "
Bejoy C Alias
Respected Contributor

Re: sendmail alias permission error

Just for a checking give 666 permission to aliases and aliases.db and do a 'sendmail -bi' or newaliases.
Be Always Joy ......
Bejoy C Alias
Respected Contributor

Re: sendmail alias permission error

OR do 'makemap hash ./aliases < ./aliases' and check whether this works ..
Be Always Joy ......
Alan Meyer_4
Respected Contributor

Re: sendmail alias permission error

changing the permissions to 666 generates:

newaliases: cannot open /etc/mail/aliases: Group writable file

for the sendmail -bi and newaliases command.

the makemap command seemed to work, but, I still cannot restart sendmail without the error message and the mail queued in the mqueue directory will not go away.
" I may not be certified, but I am certifiable... "
Jeff Schussele
Honored Contributor
Solution

Re: sendmail alias permission error

OK - it appears you upgraded sendmail - probably via a patch - but the sedndmail.cf file was *not* overwritten with the new version.
I would probably stop sendmail and reapply the patch - should be listed in the sendmail what output. Afterwards make sure the new sendmail.cf file has been written.
NOTE: you'll have to reapply any mods to the file like the smart relay, domain & such.
Then retry the newaliases command.
Let us know how it goes.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Alan Meyer_4
Respected Contributor

Re: sendmail alias permission error

I reinstalled sendmail again, but the /etc/mail/sendmail.cf file still did not get replaced. So I went to find the new one which was located under the /usr/contrib/sendmail tree and copied it to /etc/mail and restarted sendmail.

Now all is right with the world and the aliases work and the mqueue directory emptied out.

thanks for all your persistance in helping me.

-Alan
" I may not be certified, but I am certifiable... "