Re: smtpd aliases file issue

2017-05-11 Thread Edgar Pettijohn
Just for the record using a flat "file" for aliases you don't need to run 
newaliases.

⁣Sent from BlueMail ​

On May 11, 2017, 2:30 AM, at 2:30 AM, Gilles Chehade  wrote:
>Much better :-)
>
>You don’t need to restart the daemon, you simply need to tell it
>through smtpctl that the table aliases needs to be reloaded:
>
>   $ doas smtpctl update table aliases
>
>Gilles
>
>
>> On 11 May 2017, at 08:17, Ajitabh Pandey 
>wrote:
>>
>> Hi Gilles,
>>
>> I did not change anything from the default. But I realise all may not
>be
>> using default file like me and may not know what is in it. Here is a
>copy
>> of the contents just for reference. The problem is solved by
>restarting the
>> smtpd as sugested by Edgar.
>>
>> $ doas cat /etc/mail/smtpd.conf
>>
>> table aliases file:/etc/mail/aliases
>> listen on lo0
>> accept for local alias  deliver to mbox
>> accept from local for any relay
>>
>> Regards.
>> --
>> ~ajitabhpandey
>>
>> On Wed, May 10, 2017 at 5:25 PM, Gilles Chehade 
>wrote:
>>
>>> On Wed, May 10, 2017 at 04:32:55PM +0530, Ajitabh Pandey wrote:

 If my understanding about how this should work incorrect? If not
>then
>>> what
 am I doing wrong?

>>>
>>> What you are doing wrong is not showing your configuration file so
>we're
>>> able to check if it does what you think it is doing
>>>
>>>
>>> --
>>> Gilles Chehade
>>>
>>> https://www.poolp.org
>@poolpOrg
>>>
>>
>>
>>
>> --
>> Ajitabh Pandey
>> http://ajitabhpandey.info/ | http://unixclinic.net/ |
>> http://buddingthoughts.info
>> ICQ - 150615062
>> Registered Linux User - 240748


Re: smtpd aliases file issue

2017-05-11 Thread Ajitabh Pandey
Thanks Giles.

Regards.
-- 
~ajitabhpandey

On Thu, May 11, 2017 at 12:59 PM, Gilles Chehade  wrote:

> Much better :-)
>
> You don’t need to restart the daemon, you simply need to tell it through
> smtpctl that the table aliases needs to be reloaded:
>
> $ doas smtpctl update table aliases
>
> Gilles
>
>
> > On 11 May 2017, at 08:17, Ajitabh Pandey 
> wrote:
> >
> > Hi Gilles,
> >
> > I did not change anything from the default. But I realise all may not be
> > using default file like me and may not know what is in it. Here is a copy
> > of the contents just for reference. The problem is solved by restarting
> the
> > smtpd as sugested by Edgar.
> >
> > $ doas cat /etc/mail/smtpd.conf
> >
> > table aliases file:/etc/mail/aliases
> > listen on lo0
> > accept for local alias  deliver to mbox
> > accept from local for any relay
> >
> > Regards.
> > --
> > ~ajitabhpandey
> >
> > On Wed, May 10, 2017 at 5:25 PM, Gilles Chehade 
> wrote:
> >
> >> On Wed, May 10, 2017 at 04:32:55PM +0530, Ajitabh Pandey wrote:
> >>>
> >>> If my understanding about how this should work incorrect? If not then
> >> what
> >>> am I doing wrong?
> >>>
> >>
> >> What you are doing wrong is not showing your configuration file so we're
> >> able to check if it does what you think it is doing
> >>
> >>
> >> --
> >> Gilles Chehade
> >>
> >> https://www.poolp.org
> @poolpOrg
> >>
> >
> >
> >
> > --
> > Ajitabh Pandey
> > http://ajitabhpandey.info/ | http://unixclinic.net/ |
> > http://buddingthoughts.info
> > ICQ - 150615062
> > Registered Linux User - 240748
>
>


-- 
Ajitabh Pandey
http://ajitabhpandey.info/ | http://unixclinic.net/ |
http://buddingthoughts.info
ICQ - 150615062
Registered Linux User - 240748


Re: smtpd aliases file issue

2017-05-11 Thread Gilles Chehade
Much better :-)

You don’t need to restart the daemon, you simply need to tell it through 
smtpctl that the table aliases needs to be reloaded:

$ doas smtpctl update table aliases

Gilles


> On 11 May 2017, at 08:17, Ajitabh Pandey  wrote:
> 
> Hi Gilles,
> 
> I did not change anything from the default. But I realise all may not be
> using default file like me and may not know what is in it. Here is a copy
> of the contents just for reference. The problem is solved by restarting the
> smtpd as sugested by Edgar.
> 
> $ doas cat /etc/mail/smtpd.conf
> 
> table aliases file:/etc/mail/aliases
> listen on lo0
> accept for local alias  deliver to mbox
> accept from local for any relay
> 
> Regards.
> -- 
> ~ajitabhpandey
> 
> On Wed, May 10, 2017 at 5:25 PM, Gilles Chehade  wrote:
> 
>> On Wed, May 10, 2017 at 04:32:55PM +0530, Ajitabh Pandey wrote:
>>> 
>>> If my understanding about how this should work incorrect? If not then
>> what
>>> am I doing wrong?
>>> 
>> 
>> What you are doing wrong is not showing your configuration file so we're
>> able to check if it does what you think it is doing
>> 
>> 
>> --
>> Gilles Chehade
>> 
>> https://www.poolp.org  @poolpOrg
>> 
> 
> 
> 
> -- 
> Ajitabh Pandey
> http://ajitabhpandey.info/ | http://unixclinic.net/ |
> http://buddingthoughts.info
> ICQ - 150615062
> Registered Linux User - 240748



Re: smtpd aliases file issue

2017-05-11 Thread Gilles Chehade
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  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  >
> wrote:
> 
>> Did you restart smtpd?
>> 
>> Sent from BlueMail > >
>> On May 10, 2017, at 6:03 AM, Ajitabh Pandey > >
>> 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



Re: smtpd aliases file issue

2017-05-10 Thread Ajitabh Pandey
Hi Gilles,

I did not change anything from the default. But I realise all may not be
using default file like me and may not know what is in it. Here is a copy
of the contents just for reference. The problem is solved by restarting the
smtpd as sugested by Edgar.

$ doas cat /etc/mail/smtpd.conf

table aliases file:/etc/mail/aliases
listen on lo0
accept for local alias  deliver to mbox
accept from local for any relay

Regards.
-- 
~ajitabhpandey

On Wed, May 10, 2017 at 5:25 PM, Gilles Chehade  wrote:

> On Wed, May 10, 2017 at 04:32:55PM +0530, Ajitabh Pandey wrote:
> >
> > If my understanding about how this should work incorrect? If not then
> what
> > am I doing wrong?
> >
>
> What you are doing wrong is not showing your configuration file so we're
> able to check if it does what you think it is doing
>
>
> --
> Gilles Chehade
>
> https://www.poolp.org  @poolpOrg
>



-- 
Ajitabh Pandey
http://ajitabhpandey.info/ | http://unixclinic.net/ |
http://buddingthoughts.info
ICQ - 150615062
Registered Linux User - 240748


Re: smtpd aliases file issue

2017-05-10 Thread Ajitabh Pandey
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 
wrote:

> Did you restart smtpd?
>
> Sent from BlueMail 
> On May 10, 2017, at 6:03 AM, Ajitabh Pandey 
> 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


Re: smtpd aliases file issue

2017-05-10 Thread Gilles Chehade
On Wed, May 10, 2017 at 04:32:55PM +0530, Ajitabh Pandey wrote:
> 
> If my understanding about how this should work incorrect? If not then what
> am I doing wrong?
> 

What you are doing wrong is not showing your configuration file so we're
able to check if it does what you think it is doing


-- 
Gilles Chehade

https://www.poolp.org  @poolpOrg



Re: smtpd aliases file issue

2017-05-10 Thread Edgar Pettijohn
Did you restart smtpd?

⁣Sent from BlueMail ​

On May 10, 2017, 6:03 AM, at 6:03 AM, Ajitabh Pandey  
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/


smtpd aliases file issue

2017-05-10 Thread Ajitabh Pandey
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/