[FreeBSD 12.2] NEWALIASES: cannot open alias database /etc/mail/aliases

qw4rk

New Member


Messages: 5

Hey guys

this is my first thread, yay!

I've just set up a server with FreeBSD 12.2 and changed the mail address in /etc/mail/aliases (root: my@mail.foo)

To rebuild the aliases.db (which doesn't exist) I've used the following command:

Code:
root@***:/etc/mail # newaliases
WARNING: cannot open alias database /etc/mail/aliases
Cannot create database for alias file /etc/mail/aliases

I've checked the permission and also changed them but it didn't helped (currently set to default: 644). Does anyone have an idea what the problem could be?

Cheers,
Daniel
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,745
Messages: 36,547

Did you increase the security level perhaps? And what are the permissions and ownership of /etc/ and /etc/mail?
Code:
dice@lady3jane:~ % ls -ld /etc /etc/mail
drwxr-xr-x  25 root  wheel  109 Jan 16 20:49 /etc
drwxr-xr-x   3 root  wheel   18 Jan 16 16:16 /etc/mail
Code:
-rw-r--r--   1 root  wheel    1691 Oct 23 07:39 aliases
-rw-r-----   1 root  wheel  131072 Jan 16 16:15 aliases.db
This is on a freshly built 12.2 server, built it this weekend. Judging by the timestamps last Saturday afternoon.
 
OP
Q

qw4rk

New Member


Messages: 5

Hi SirDice,

thank you! Now I've changed the ownership of /etc/ and /etc/mail and it worked:

Code:
root@***:/ # newaliases
/etc/mail/aliases: 30 aliases, longest 27 bytes, 328 bytes total

I am not sure why there were not enough rights on /etc/. I'll investigate. Again, thank you! :)
 
OP
Q

qw4rk

New Member


Messages: 5

It was set to 644 but I've already found the reason... It was a bug in my ansible playbook.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,745
Messages: 36,547

Alright. I have to mention this as you don't seem to understand the difference between ownership and permissions. Ownership is which account and group owns the file/directory, in this case the ownership is root:wheel. Permissions are what the owner, group and other's can do, that's 644 in this case.
 
OP
Q

qw4rk

New Member


Messages: 5

Ah gosh, sorry.. that was a typo, of course I meant permissions ^^
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,745
Messages: 36,547

I can relate to that. I had the impression you were misunderstanding it, hence the extra explanation. No worries, perhaps it'll do someone else some good when they find this thread through a google search in about 5 years ;)
 
Top