Symptom:

 root@xen-revma:~# newaliases 
 postalias: fatal: open database /etc/aliases.db: Permission denied

Solution:

Postfix internally calls “set user id” and “set group id” for running process. So your newaliaseses no longer runs as root:root. Here is an example

root@xen-revma:~# ls -al /etc/aliases 
-rw-r--r-- 1 bind mysql 42 Jun 23 12:30 /etc/aliases

numericaly:

root@xen-revma:~# ls -al /etc/aliases  -n
-rw-r--r-- 1 110 114 42 Jun 23 12:30 /etc/aliases

</code>

root@xen-revma:~# strace newaliases 2>&1 | grep set | grep id

set_tid_address(0x7f8147a0a9d0)         = 9960
set_tid_address(0x7efd9013e9d0)         = 9960
setresgid(-1, 114, -1)                  = 0
setresuid(-1, 110, -1)                  = 0

As you can see, the process is setting (=0 successfully) or better dropping permissions to 110:114. Exactly as the file /etc/aliases owner:group is.

root@xen-revma:~# chown root:root /etc/aliases 
root@xen-revma:~# newaliases 

And everything works fine

 
linux/postfix/aliases.txt · Last modified: 2016/11/09 21:29 by admin