LDAP aliases

2012-03-06 Thread Frank Bonnet

Hello

I have a small problem with LDAP aliases at 2.9.1
but cannot find what I missed ...

in main.cf I have the following

alias_maps = hash:/etc/mail/aliases, 
ldap:/usr/local/etc/postfix/ldap-aliases.cf


in ldap-aliases.cf I have the following

server_host = my.ldap.server
search_base = ou=Users,dc=xxx,dc=xx
query_filter = mail=%s
result_attribute = uid
version = 3

the LDAP lookup is OK, bonj is the uid and jean.bon is the LDAP alias

postmap -q jean@xxx.xx ldap:/usr/local/etc/postfix/ldap-aliases.cf
bonj

But when I send an email to jean@xxx.xx Postfix return
a jean.bon unknown user  error.

What did I forgot in configuration to make the reverse mapping
ALIAS -- UID  working ?

Thanks




Re: LDAP aliases

2012-03-06 Thread Reinaldo de Carvalho
On Tue, Mar 6, 2012 at 8:36 AM, Frank Bonnet f.bon...@esiee.fr wrote:

 in main.cf I have the following

 alias_maps = hash:/etc/mail/aliases,
 ldap:/usr/local/etc/postfix/ldap-aliases.cf

 in ldap-aliases.cf I have the following

 server_host = my.ldap.server
 search_base = ou=Users,dc=xxx,dc=xx
 query_filter = mail=%s
 result_attribute = uid
 version = 3

 the LDAP lookup is OK, bonj is the uid and jean.bon is the LDAP alias

 postmap -q jean@xxx.xx ldap:/usr/local/etc/postfix/ldap-aliases.cf
 bonj

 But when I send an email to jean@xxx.xx Postfix return
 a jean.bon unknown user  error.

 What did I forgot in configuration to make the reverse mapping
 ALIAS -- UID  working ?


Alas maps query don't have domain part. You need test:

postmap -q jean.bon ldap:/usr/local/etc/postfix/ldap-aliases.cf

-- 
Reinaldo de Carvalho
http://korreio.sf.net
http://python-cyrus.sf.net

While not fully understand a software, don't try to adapt this
software to the way you work, but rather yourself to the way the
software works (myself)


Re: LDAP aliases

2012-03-06 Thread Frank Bonnet

On 03/06/2012 01:09 PM, Reinaldo de Carvalho wrote:

On Tue, Mar 6, 2012 at 8:36 AM, Frank Bonnetf.bon...@esiee.fr  wrote:

in main.cf I have the following

alias_maps = hash:/etc/mail/aliases,
ldap:/usr/local/etc/postfix/ldap-aliases.cf

in ldap-aliases.cf I have the following

server_host = my.ldap.server
search_base = ou=Users,dc=xxx,dc=xx
query_filter = mail=%s
result_attribute = uid
version = 3

the LDAP lookup is OK, bonj is the uid and jean.bon is the LDAP alias

postmap -q jean@xxx.xx ldap:/usr/local/etc/postfix/ldap-aliases.cf
bonj

But when I send an email to jean@xxx.xx Postfix return
a jean.bon unknown user  error.

What did I forgot in configuration to make the reverse mapping
ALIAS --  UID  working ?


Alas maps query don't have domain part. You need test:

postmap -q jean.bon ldap:/usr/local/etc/postfix/ldap-aliases.cf



OK  corrected ,  thank you .




Re: header_checks and ldap aliases

2011-09-02 Thread Selcuk Yazar
Thanks it works! with protected_destinations and insider settings

selçuk

On Thu, Sep 1, 2011 at 7:36 PM, Noel Jones njo...@megan.vbhcs.org wrote:

 On 9/1/2011 9:53 AM, Selcuk Yazar wrote:
  Hi,
 
  We have ldap aliases. in main.cf http://main.cf
  virtual_alias_maps : ldap:aliases, ldap:accountsmap setting.
 
  i want to create a control for these aliases that sent mail only
  internal with using header_checks. but header_checks restriction
  doesn't wok with above settings.



 header_checks are the wrong tool for the job.  To protect a mail
 alias, see this example:
 http://www.postfix.org/RESTRICTION_CLASS_README.html#internal



  -- Noel Jones




-- 
Selçuk YAZAR
http://www.selcukyazar.blogspot.com


header_checks and ldap aliases

2011-09-01 Thread Selcuk Yazar
Hi,

We have ldap aliases. in main.cf
virtual_alias_maps : ldap:aliases, ldap:accountsmap setting.

i want to create a control for these aliases that sent mail only internal
with using header_checks. but header_checks restriction doesn't wok with
above settings.
any way i also enable forward thing.for this i applied

ldap-forward-example.cf:
--
Code:
server_host = ldap-server.example.com
search_base = ou=People,dc=example,dc=com
version=3
timeout = 10
size_limit = 1
bind = yes
bind_dn = cn=Manager,dc=example,dc=com
bind_pw = password
query_filter = (mail=%s)
result_attribute = mail, addressToForward
--

Within the main.cf file:


virtual_alias_maps = ldap:/etc/postfix/ldap-forward-example.cf
configuration. this time header_checks works. also forward works but
after
that i have mail,
testalias@domain. user_unknow.  what is the problem ?. i think postfix
find aliases and deliver mails to aliases members, also postfix deliver copy
of mail to aliases member's forward address but server says user_unknown.

thanks in advance.


-- 
Selçuk YAZAR


Re: header_checks and ldap aliases

2011-09-01 Thread Noel Jones
On 9/1/2011 9:53 AM, Selcuk Yazar wrote:
 Hi,
 
 We have ldap aliases. in main.cf http://main.cf
 virtual_alias_maps : ldap:aliases, ldap:accountsmap setting.
 
 i want to create a control for these aliases that sent mail only
 internal with using header_checks. but header_checks restriction
 doesn't wok with above settings.



header_checks are the wrong tool for the job.  To protect a mail
alias, see this example:
http://www.postfix.org/RESTRICTION_CLASS_README.html#internal



  -- Noel Jones


LDAP aliases problem

2009-05-13 Thread Mickaël Canévet
Hi,

I have some trouble trying to validate mail aliases from LDAP.

My users are defined in LDAP with the attribute 'mail' that stores each
mail alias and the attribute mailRoutingAddress that stores the real
mail address (corresponding to uid).

for example:
dn: uid=lastname, ou=people, dc=mydomain, dc=com
mail: lastn...@mydomain.com
mail: lastn...@mydomain.eu
mail: firstname.lastn...@mydomain.com
mail: firstname.lastn...@mydomain.eu
mailRoutingAddress: lastn...@mydomain.com

I can send mail to lastn...@mydomain.com and lastn...@mydomain.eu, but
when I try to send a mail to firstname.lastn...@mydomain.com or
firstname.lastn...@mydomain.eu my mail is bounced with the error
message: unknown user: firstname.lastname.

When I use postmap it works fine:

# postmap -q firstname.lastn...@mydomain.eu
ldap:/etc/postfix/ldap-aliases.cf
lastn...@mydomain.com

Another weird thing is that when I use this:

query_filter = mail...@mydomain.com

instead of:

query_filter = mail=%s

it works (but it's ugly) even for mydomain.eu that is really weird...

I tried with mail...@%d which would be less ugly, but it does not work
nether.

Any idea ?

Thanks a lot


Here is my configuration:

$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases, ldap:/etc/postfix/ldap-aliases.cf
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
mydomain.eu
mynetworks = 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

$ cat /etc/postfix/ldap-aliases.cf 
server_host = ldap://ldap1.embl.fr ldap://ldap2.embl.fr
search_base = ou=people, dc=embl-grenoble, dc=fr
query_filter = mail=%s
result_attribute = mailRoutingAddress


-- 
Mickaël CANÉVET.
European Molecular Biology Laboratory (EMBL)
Grenoble Outstation. FRANCE


signature.asc
Description: This is a digitally signed message part


Re: LDAP aliases problem

2009-05-13 Thread Victor Duchovni
On Wed, May 13, 2009 at 04:46:02PM +0200, Micka?l Can?vet wrote:

 Hi,
 
 I have some trouble trying to validate mail aliases from LDAP.
 
 My users are defined in LDAP with the attribute 'mail' that stores each
 mail alias and the attribute mailRoutingAddress that stores the real
 mail address (corresponding to uid).
 
 for example:
 dn: uid=lastname, ou=people, dc=mydomain, dc=com
 mail: lastn...@mydomain.com
 mail: lastn...@mydomain.eu
 mail: firstname.lastn...@mydomain.com
 mail: firstname.lastn...@mydomain.eu
 mailRoutingAddress: lastn...@mydomain.com
 
 I can send mail to lastn...@mydomain.com and lastn...@mydomain.eu, but
 when I try to send a mail to firstname.lastn...@mydomain.com or
 firstname.lastn...@mydomain.eu my mail is bounced with the error
 message: unknown user: firstname.lastname.

The lookup key for aliases(5) with local(8) delivery is as documented
just the username without the domain.

 # postmap -q firstname.lastn...@mydomain.eu
 ldap:/etc/postfix/ldap-aliases.cf
 lastn...@mydomain.com

Wrong lookup key.

 Another weird thing is that when I use this:
 
 query_filter = mail...@mydomain.com
 
 instead of:
 
 query_filter = mail=%s
 
 it works (but it's ugly) even for mydomain.eu that is really weird...

Not weird at all.

-- 
Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
mailto:majord...@postfix.org?body=unsubscribe%20postfix-users

If my response solves your problem, the best way to thank me is to not
send an it worked, thanks follow-up. If you must respond, please put
It worked, thanks in the Subject so I can delete these quickly.


ldap aliases

2008-07-26 Thread Norberto Bensa

Hello list!

I'm trying to move my aliases to ldap. It's somewhat working right now  
but I have a question.


It seems that Postfix searches the database by the username part of  
the email account. For example if I send email to [EMAIL PROTECTED]  
(note that bensa.ar doesn't exist on the internet) Postfix checks for  
norberto not [EMAIL PROTECTED]



main.cf:

alias_maps  = hash:/etc/mail/aliases
  ldap:/etc/postfix/ldap-aliases.cf


ldap-aliases.cf:

bind= no
server_host = ldap://127.0.0.1/
search_base = ou=users,dc=bensa,dc=ar
scope   = sub
size_limit  = 1
query_filter= ((objectClass=inetLocalMailRecipient)(mail=%s))
result_attribute= mailLocalAddress


$ ldapsearch -x 'uid=nbensa' mailLocalAddress mail

dn: uid=nbensa,ou=users,dc=bensa,dc=ar
mail: [EMAIL PROTECTED]
mail: [EMAIL PROTECTED]
mail: [EMAIL PROTECTED]
mailLocalAddress: [EMAIL PROTECTED]



If I change query_filter to [EMAIL PROTECTED] then it works, but then  
I loss the ability to do virtual domains.


I'm sure I'm missing something, but I don't know what.

Many thanks in advance,
Norberto


This message was sent using IMP, the Internet Messaging Program.