Restore rm-ed mail aliases

OBSD-6.8-cur YASM OpenSMTP

2020-12-01


I was about to create a new alias, saw a dummy document /etc/mail/alias (missing the plural - aliases)

On the verge of Sanitizing accidently rm-ed /etc/mail/aliases I felt a chill on my spine after that - no pun

Going through newaliases(8) I found makemap(8) - create database maps for smtpd

Blind luck I had aliases.db and makemap(8) has -U which dumps contents of database to text

$ makemap -U /etc/mail/aliases.db | sed -E 's/[[:blank:]]/: /g' 

Gnu-ism \t don't work but OBSD's sed supports Extended Regular POSIX expression

Made sure to check stdout and redirected to /etc/mail/aliases

Back to Being puffy!