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 <[email protected]>
wrote:

> Did you restart smtpd?
>
> Sent from BlueMail <http://www.bluemail.me/r?b=9531>
> On May 10, 2017, at 6:03 AM, Ajitabh Pandey <[email protected]>
> 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://unixclinic.net/ |
http://buddingthoughts.info
ICQ - 150615062
Registered Linux User - 240748

Reply via email to