question : local_recipient_maps does not work !

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

question : local_recipient_maps does not work !

Mohammad Ghobadi
hi 
i am new to postfix and i trying to learn it ...
and i new to postfix mailing list , so sorry if doing something wrong 

QUESTION IS  : 
i read  these document's :


i trying figure out how local_recipient_maps work ...
so i change it to : 
local_recipient_maps = hash:/etc/postfix/userlist
and 
postmap hash:/etc/postfix/userlist
service postfix restart 

/etc/postfix/userlist :
alex           exists 
amin          exists 

i expect that mail for alex@localhost. and amin@localhost. delivered to /var/spool/mail and mail's to other user's of my system (like root or test) bounced (or rejected) 


but when send mail to alex (there is no alex user in my system ) it bounced with (unknown user: "alex") , and when i send mail to test user it delivered ... 
(echo test | mail -s test alex@localhsot. ) 

i ask a guy in irc and he told me that postfix/local need uid and gid to deliver local mail , that is reasonable but why it still deliver mail for root or test ??

can any body explain that ? or suggest me document that show how local_recipient_maps work ? 

thank you guys :) 

here is my config in main.cf
mydomain = home
myhostname = laptop
myorigin = $myhostname 
relay_domains = $mydestination   
mydestination = localhost $myhostname laptop
mynetworks = 127.0.0.1 
alias_maps = 
alias_database = 
local_recipient_maps =  hash:/etc/postfix/userlist
 

and this is my log : 

Sep  2 14:03:13 laptop postfix/master[31659]: terminating on signal 15
Sep  2 14:03:14 laptop postfix/master[7899]: daemon started -- version 2.11.0, configuration /etc/postfix
Sep  2 14:03:19 laptop postfix/pickup[7902]: 10F681658E3: uid=0 from=<[hidden email]>
Sep  2 14:03:19 laptop postfix/cleanup[7908]: 10F681658E3: message-id=<20160902093319.10F681658E3@laptop>
Sep  2 14:03:19 laptop postfix/qmgr[7903]: 10F681658E3: from=<[hidden email]>, size=322, nrcpt=1 (queue active)
Sep  2 14:03:19 laptop postfix/local[7910]: 10F681658E3: to=<test@localhost>, orig_to=<test@localhost.>, relay=local, delay=0.19, delays=0.13/0/0/0.05, dsn=2.0.0, status=sent (delivered to mailbox)
Sep  2 14:03:19 laptop postfix/qmgr[7903]: 10F681658E3: removed
Sep  2 14:03:29 laptop postfix/pickup[7902]: DE7F51658E3: uid=0 from=<[hidden email]>
Sep  2 14:03:29 laptop postfix/cleanup[7908]: DE7F51658E3: message-id=<20160902093329.DE7F51658E3@laptop>
Sep  2 14:03:29 laptop postfix/qmgr[7903]: DE7F51658E3: from=<[hidden email]>, size=322, nrcpt=1 (queue active)
Sep  2 14:03:30 laptop postfix/local[7910]: DE7F51658E3: to=<alex@localhost>, orig_to=<alex@localhost.>, relay=local, delay=0.14, delays=0.08/0/0/0.06, dsn=5.1.1, status=bounced (unknown user: "alex")
Sep  2 14:03:30 laptop postfix/cleanup[7908]: 00642165924: message-id=<20160902093330.00642165924@laptop>
Sep  2 14:03:30 laptop postfix/bounce[7915]: DE7F51658E3: sender non-delivery notification: 00642165924
Sep  2 14:03:30 laptop postfix/qmgr[7903]: 00642165924: from=<>, size=2018, nrcpt=1 (queue active)
Sep  2 14:03:30 laptop postfix/qmgr[7903]: DE7F51658E3: removed
Sep  2 14:03:30 laptop postfix/smtp[7916]: 00642165924: to=<[hidden email]>, relay=none, delay=0.11, delays=0.03/0.07/0.01/0, dsn=5.4.6, status=bounced (mail for laptop.Home loops back to myself)
Sep  2 14:03:30 laptop postfix/qmgr[7903]: 00642165924: removed

 


Reply | Threaded
Open this post in threaded view
|

Re: question : local_recipient_maps does not work !

Wietse Venema
Mohammad Ghobadi:
> i trying figure out how local_recipient_maps work ...

As documented local_recipient_maps lists the users for the domains
in $mydestination (and some stuff with $inet_interfaces that is
not relevant for your question).

> local_recipient_maps = hash:/etc/postfix/userlist
> and
> postmap hash:/etc/postfix/userlist
> service postfix restart
>
> /etc/postfix/userlist :
> alex           exists
> amin          exists
>
> i expect that mail for alex@localhost. and amin@localhost. delivered to
> /var/spool/mail and mail's to other user's of my system (like root or test)
> bounced (or rejected)

Only if localhost is listed in $mydestination.
 
        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: question : local_recipient_maps does not work !

Mohammad Ghobadi
Wietse Venema 
thank you 
>Only if localhost is listed in $mydestination.
but localhost is listed in $mydestination ... it seems ignoring my list in /etc/postfix/userlist !!?


On Fri, Sep 2, 2016 at 4:07 PM, Wietse Venema <[hidden email]> wrote:
Mohammad Ghobadi:
> i trying figure out how local_recipient_maps work ...

As documented local_recipient_maps lists the users for the domains
in $mydestination (and some stuff with $inet_interfaces that is
not relevant for your question).

> local_recipient_maps = hash:/etc/postfix/userlist
> and
> postmap hash:/etc/postfix/userlist
> service postfix restart
>
> /etc/postfix/userlist :
> alex           exists
> amin          exists
>
> i expect that mail for alex@localhost. and amin@localhost. delivered to
> /var/spool/mail and mail's to other user's of my system (like root or test)
> bounced (or rejected)

Only if localhost is listed in $mydestination.

        Wietse

Reply | Threaded
Open this post in threaded view
|

Re: question : local_recipient_maps does not work !

Wietse Venema
Mohammad Ghobadi:
> Wietse Venema
> thank you
> >Only if localhost is listed in $mydestination.
> but localhost is listed in $mydestination ... it seems ignoring my list in
> /etc/postfix/userlist !!?

Show "postconf -n" command output.

Show postfix logging.

TO REPORT A PROBLEM see http://www.postfix.org/DEBUG_README.html#mail

TO (UN)SUBSCRIBE see http://www.postfix.org/lists.html

Thank you for using Postfix.
Reply | Threaded
Open this post in threaded view
|

Re: question : local_recipient_maps does not work !

Wietse Venema
In reply to this post by Mohammad Ghobadi
Mohammad Ghobadi:
> Wietse Venema
> I send my config and my log at the end of first mail actualy ...

Note that local_recipient_maps is primarily for SMTP mail.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: question : local_recipient_maps does not work !

Noel Jones-2
In reply to this post by Mohammad Ghobadi
On 9/2/2016 4:48 AM, Mohammad Ghobadi wrote:
>
> /etc/postfix/userlist :
> alex           exists
> amin          exists
>
>
> but when send mail to alex (there is no alex user in my system ) it
> bounced with (unknown user: "alex") ,

Listing a user in local_recipients_maps does not automatically
create the user.  You must create the user by whatever method is
appropriate for your system, such as adduser(8).

> and when i send mail to test
> user it delivered ...
> (echo test | mail -s test alex@localhsot. )

local_recipients_maps is used during SMTP, not during local mail
submission.  If you submit mail via SMTP unlisted users will be
rejected.




  -- Noel Jones
Reply | Threaded
Open this post in threaded view
|

Re: question : local_recipient_maps does not work !

Mohammad Ghobadi
Noel Jones
Wietse Venema

thank you guy's 
i send mail via SMTP and it's work 

On Fri, Sep 2, 2016 at 6:44 PM, Noel Jones <[hidden email]> wrote:
On 9/2/2016 4:48 AM, Mohammad Ghobadi wrote:
>
> /etc/postfix/userlist :
> alex           exists
> amin          exists
>
>
> but when send mail to alex (there is no alex user in my system ) it
> bounced with (unknown user: "alex") ,

Listing a user in local_recipients_maps does not automatically
create the user.  You must create the user by whatever method is
appropriate for your system, such as adduser(8).

> and when i send mail to test
> user it delivered ...
> (echo test | mail -s test alex@localhsot. )

local_recipients_maps is used during SMTP, not during local mail
submission.  If you submit mail via SMTP unlisted users will be
rejected.




  -- Noel Jones