Loading ...
Sorry, an error occurred while loading the content.

Re: local_recipient_maps with LDAP

Expand Messages
  • Jamrock
    Marco Rebsamen wrote in message news:F70FD6682C026E40970A322E98E7645454E8@tranceiver.hive.loc... Hello Everybody I wan t to have my
    Message 1 of 4 , Aug 30, 2010
      "Marco Rebsamen" <mrebsamen@...> wrote in message news:F70FD6682C026E40970A322E98E7645454E8@......

      Hello Everybody


      I wan’t to have my local recipeints checked against my Active Directory. So I have created the .cf file with the LDAP parameters:


      bind_dn = user@...

      bind_pw = ******

      server_host =


      #Global Catalog port

      server_port = 3268


      search_base = DC=domain, DC=local

      query_filter = proxyAddresses=*%s*


      and changed the main.cf file:

      local_recipient_maps = ldap:/etc/postfix/local_recipient_maps.cf unix:passwd.byname


      If i do this now:

      postmap -v -q 'user@...' ldap:/etc/postfix/local_recipient_maps.cf


      It tells me „Search found 1 match(es)“. But If i try to deliver a message with the same address postfix tells me „User not known in local recipient maps“

      How can i figure out whats wrong ?





      The following has worked for me.  Don't know if it is the best way or not.


      Step 1


      Create a user in Active Directory for Postfix to use. 

      First name = postfix

      Lastname =

      User Logon Name = postfix

      User cannot change password

      Password never expires



      Step 2


      Add the following to the /etc/postfix/main.cf:

      # Prevents mail from being sent to local user accounts

      local_transport = virtual

      # Information about mailboxes

      virtual_mailbox_base = /var/postfix/maildirs/

      virtual_mailbox_maps = ldap:/etc/postfix/ldap_mailboxes.cf

      virtual_minimum_uid = 501

      virtual_uid_maps = static:501

      virtual_gid_maps = static:502

      # Files storing user and group information

      virtual_maps = ldap:/etc/postfix/ldap_users.cf, ldap:/etc/postfix/ldap_groups.cf


      Step 3

      Create /etc/postfix/ldap_mailboxes.cf

      server_host = ldap://mail.testcompany.com:389

      version = 3

      search_base = cn=users,dc=testcompany,dc=com

      query_filter = (&(mail=%s) (objectClass=user))

      result_attribute = samaccountname

      result_format = %s/

      bind_dn = postfix

      bind_pw = DFD321


      Step 4

      Create /etc/postfix/ldap_users.cf

       server_host = ldap://mail.testcompany.com:389

      version = 3

      search_base = cn=users,dc=testcompay,dc=com

      query_filter = (&(mail=%s) (objectClass=user))

      result_attribute = samaccountname

      bind_dn = postfix

      bind_pw = DFD321


      Step 5

      Create /etc/postfix/ldap_groups.cf

       server_host = ldap://mail.testcompany.com:389

      version = 3

      search_base = ou=mail_groups,dc=testcompay,dc=com

      query_filter = (&(mail=%s) (objectClass = group))

      special_result_attribute = member

      leaf_result_attribute = mail

      bind_dn = postfix

      bind_pw = DFD321


      Once you get this working, you will need to think about ssl encryption between the Linux box and the Windows box.

    Your message has been successfully submitted and would be delivered to recipients shortly.