Obviously you don’t need to restart the daemon to pickup new aliases. If you are using a plain file aliases map it can be reloaded atomically at runtime using smtpctl. If you are using a db file, it can be rebuilt using the newaliases / makemap utility.
I can’t tell you which one to use because you still didn’t show your config, but just for documentation purpose: you’re not doing it right. Gilles > On 11 May 2017, at 08:13, Ajitabh Pandey <ajitabhpan...@gmail.com> wrote: > > Thanks Edgar. That worked. This is what I was missing. > > I actually removed my .forward from the user01 account now and directly > updated the aliases file to forward email to external email address. > > Just for documentation purpose, here are the steps - > > $ doas vi /etc/mail/aliases file > $ doas newaliases > $ doas rcctl restart smtpd > > Regards. > -- > ~ajitabhpandey > > On Wed, May 10, 2017 at 4:58 PM, Edgar Pettijohn <ed...@pettijohn-web.com > <mailto:ed...@pettijohn-web.com>> > wrote: > >> Did you restart smtpd? >> >> Sent from BlueMail <http://www.bluemail.me/r?b=9531 >> <http://www.bluemail.me/r?b=9531>> >> On May 10, 2017, at 6:03 AM, Ajitabh Pandey <ajitabhpan...@gmail.com >> <mailto:ajitabhpan...@gmail.com>> >> wrote: >>> >>> Hello, >>> >>> On an OpenBSD 6.1, I have default smtpd setup. >>> >>> I placed a .forward file in root's home and am able to receive the emails >>> on an external address. >>> >>> I then removed the .forward from root's home and then placed a .forward in >>> the home directory of normal user account (say user01). Emails directly >>> send to user01 are being forwarded to external email address as expected. >>> >>> Next I edited the /etc/mail/aliases file and uncomment the line with root's >>> name in it and placed an entry like - >>> >>> root: user01 >>> >>> After saving the file, I ran newaliases to generate /etc/mail/aliases.db >>> file. >>> >>> This should forward all email's destined for root to user01 and >>> consequently to external email address as user01's home has a .forward file >>> in it. >>> >>> This is not happening. Any email sent to root is being delivered to the >>> mailbox of root and the smtpd logs in /var/log/maillog confirmed the same. >>> >>> If my understanding about how this should work incorrect? If not then what >>> am I doing wrong? >>> >>> Thanks and Regards. >>> >>> > > > -- > Ajitabh Pandey > http://ajitabhpandey.info/ <http://ajitabhpandey.info/> | > http://unixclinic.net/ <http://unixclinic.net/> | > http://buddingthoughts.info <http://buddingthoughts.info/> > ICQ - 150615062 > Registered Linux User - 240748