Missing FreeBSD map file

Software

Today I learned FreeBSD can’t lodge email reports for root if aliases.db was never created, either in bsdinstall or your jail.

Long story short, I was seeing this after sudo-ing into a new instance:

[date] [hostname] sudo: [user]: user NOT in sudoers ; [..]

Heh, my bad. But then this appeared:

SYSERR(root): hash map "Alias0": missing map file /etc/mail/aliases.db
No such file or directory

Huh. So just to try, I “created” the file thusly:

# touch /etc/mail/aliases.db

Needless to say, that didn’t work! The solution, ironically from some ancient Red Hat docs:

# makemap hash /etc/mail/aliases.db < /etc/mail/aliases

This command must be run after creating an /etc/mail/aliases file. You also need to run it if you make any changes.

Happy long weekend!

Author bio and support

Me!

Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

You can leave me a comment by contacting me, and I might publish your thoughts. Please read the FAQs first though.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!