I noticed that the praliases command only works ifOn Slackware, all my .db are root-only, but some of the files that make
/etc/mail/aliases.db is globally readable.
-rw-r--r-- 1 smmta smmsp 2165 30. Jan 12:17 /etc/mail/aliases.dbls -l /etc/mail/{aliases,*.db}
exe="/usr/libexec/sendmail/praliases" subj=unconfined key="aliases"Sendmail in libexec? Debian sure does it weird.
type=SYSCALL msg=audit(1769773585.836:438): arch=c000003e syscall=257 success=yes exit=5 a0=ffffffffffffff9c a1=7fff4dace1f0 a2=0 a3=0Is your praliases setuid/setgid to something? My user can't "praliases"
items=1 ppid=4200 pid=4203 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0
egid=0 sgid=0 fsgid=0 tty=pts1 ses=1 comm="praliases" exe="/usr/libexec/sendmail/praliases" subj=unconfined key="aliases"
Which lets me assume the access is being done by root.
root@deb-test:~# strace praliases 2>&1 |grep alias execve("/usr/sbin/praliases", ["praliases"], 0x7ffde3b673e0 /* 11 vars */) = 0
newfstatat(AT_FDCWD, "/etc/mail/aliases.db", {st_mode=S_IFREG|0640, st_size=2165, ...}, 0) = 0
newfstatat(AT_FDCWD, "/etc/mail/aliases.db", {st_mode=S_IFREG|0640, st_size=2165, ...}, 0) = 0
write(2, "praliases: /etc/mail/aliases: op"..., 54praliases: /etc/mail/aliases: open: Permission denied
root@deb-test:~#
What is the reason for that?
Marco Moock <mm@dorfdsl.de> writes:
I noticed that the praliases command only works ifOn Slackware, all my .db are root-only, but some of the files that
/etc/mail/aliases.db is globally readable.
make them are world readable. Sendmail is using the .db files.
-rw-r--r-- 1 smmta smmsp 2165 30. Jan 12:17 /etc/mail/aliases.dbls -l /etc/mail/{aliases,*.db}
-rw-r----- 1 root root 12288 Nov 15 2024 /etc/mail/access.db
-rw-r--r-- 1 root root 800 Oct 17 2023 /etc/mail/aliases
-rw-r----- 1 root root 12288 Oct 17 2023 /etc/mail/aliases.db
-rw-r----- 1 root root 12288 Mar 19 2022 /etc/mail/authinfo.db
-rw-r----- 1 root root 12288 Apr 14 2022 /etc/mail/domaintable.db
-rw-r----- 1 root root 12288 Apr 25 2024 /etc/mail/mailertable.db
-rw-r----- 1 root root 12288 Apr 25 2024 /etc/mail/uudomain.db
-rw-r----- 1 root root 12288 Jan 9 2018 /etc/mail/virtusertable.db
exe="/usr/libexec/sendmail/praliases" subj=unconfined key="aliases"Sendmail in libexec? Debian sure does it weird.
type=SYSCALL msg=audit(1769773585.836:438): arch=c000003e
syscall=257 success=yes exit=5 a0=ffffffffffffff9c a1=7fff4dace1f0
a2=0 a3=0 items=1 ppid=4200 pid=4203 auid=1000 uid=0 gid=0 euid=0
suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=1 comm="praliases" exe="/usr/libexec/sendmail/praliases" subj=unconfined key="aliases"
Which lets me assume the access is being done by root.
root@deb-test:~# strace praliases 2>&1 |grep alias execve("/usr/sbin/praliases", ["praliases"], 0x7ffde3b673e0 /* 11
vars */) = 0 newfstatat(AT_FDCWD, "/etc/mail/aliases.db", {st_mode=S_IFREG|0640, st_size=2165, ...}, 0) = 0
newfstatat(AT_FDCWD, "/etc/mail/aliases.db", {st_mode=S_IFREG|0640, st_size=2165, ...}, 0) = 0
write(2, "praliases: /etc/mail/aliases: op"..., 54praliases: /etc/mail/aliases: open: Permission denied
root@deb-test:~#
What is the reason for that?Is your praliases setuid/setgid to something? My user can't
"praliases" but root can.
Hello!
I have a Debian unstable system to test.
I noticed that the praliases command only works if /etc/mail/aliases.db
is globally readable.
-rw-r--r-- 1 smmta smmsp 2165 30. Jan 12:17 /etc/mail/aliases.db
I now used strace to track that down:
This is when it works (world readable):
root@deb-test:~# ls -la /etc/mail/aliases.db -rw-r--r-- 1 smmta smmsp
2165 30. Jan 12:17 /etc/mail/aliases.db root@deb-test:~# strace
praliases 2>&1 |grep alias execve("/usr/sbin/praliases", ["praliases"], 0x7ffe430974f0 /* 11 vars */) = 0 newfstatat(AT_FDCWD, "/etc/mail/aliases.db", {st_mode=S_IFREG|0644, st_size=2165, ...}, 0) =
0 newfstatat(AT_FDCWD, "/etc/mail/aliases.db", {st_mode=S_IFREG|0644, st_size=2165, ...}, 0) = 0 openat(AT_FDCWD, "/etc/mail/aliases.db",
O_RDONLY) = 4 openat(AT_FDCWD, "/etc/mail/aliases.db", O_RDONLY) = 5 root@deb-test:~#
root@deb-test:~# strace praliases 2>&1 |grep alias execve("/usr/sbin/praliases", ["praliases"], 0x7ffde3b673e0 /* 11 vars
*/) = 0 newfstatat(AT_FDCWD, "/etc/mail/aliases.db",
{st_mode=S_IFREG|0640, st_size=2165, ...}, 0) = 0 newfstatat(AT_FDCWD, "/etc/mail/aliases.db", {st_mode=S_IFREG|0640, st_size=2165, ...}, 0) =
0 write(2, "praliases: /etc/mail/aliases: op"..., 54praliases: /etc/mail/aliases: open: Permission denied root@deb-test:~#
What is the reason for that?
Which permissions does it want (I prefer only readable by the daemon's
users) and why?
That is interesting. Can you show the ls -la of the files?ls -la /etc/mail
What happens if you remove the world readability?Then only root reads it.
IIRC sendmail can use text-only files without the DBs, can you checkMaybe Sendmail can be built like that, but it won't use the plain text
with strace if it falls back to this?
m@deb-test:~$ ls -la /usr/libexec/sendmail/praliasesThis is looking Debian-specific. What does the listener and the queue
-rwxr-xr-x 1 root root 99600 26. Okt 02:00 /usr/libexec/sendmail/praliases
Good luck, maybe others can chip in. Or may have beter understanding of
the Sendmail code.
Hugo Villeneuve-Lapointe <hugo_villap@email.invalid> wrote:
Good luck, maybe others can chip in. Or may have beter
understanding of the Sendmail code.
Why not use LDAP for all the DBs and aliases? It is easy to set up and
avoids having to run makemap and praliases. File sendmail.schema just
has to be included in OpenLDAP. Probably works fine 389ds too.
This is looking Debian-specific. What does the listener and the queue
runner run as?
On 31.01.2026 11:26 Uhr jayjwa wrote:
This is looking Debian-specific. What does the listener and the queue
runner run as?
Daemon is running as root.
My "strace" shows things similar to you. "aliases.db" is "stat()" first
than "open()" when it works. But fails after "stat()" without "open()"
in the failing case.
I did not debug a running binary but from Sendmail's source code, "safefile()" from "libsmutil/safefile.c" is called before opening a
database file.
That "safefile()" function can actually set errno=EACCESS if it doesn't
like something about the file permissions of a file.
Anyway, "safefile()" seems to really want the user/group of the running Sendmail program to have read access as one of the owner/group/other of
the target file. And checks against information returned by "stat()".
On 31.01.2026 19:28 Uhr Kalevi Kolttonen wrote:
Hugo Villeneuve-Lapointe <hugo_villap@email.invalid> wrote:
Good luck, maybe others can chip in. Or may have beter
understanding of the Sendmail code.
Why not use LDAP for all the DBs and aliases? It is easy to set up and
avoids having to run makemap and praliases. File sendmail.schema just
has to be included in OpenLDAP. Probably works fine 389ds too.
Because I am not familiar with that and have no need for it. The
aliases will be updated when needed by me.
fbsd15:~ $ cat /root/bin/sm_add_alias_value
...
ldapmodify -ZZ -D cn=root,dc=fbsd15,dc=local -w pw -h fbsd15.local -f <(cat <<EOF
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 59 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 19:25:34 |
| Calls: | 810 |
| Calls today: | 1 |
| Files: | 1,287 |
| D/L today: |
10 files (21,017K bytes) |
| Messages: | 193,987 |