config :
server_host = SERVEURAD.domaine.net
server_port = 389
version = 3
bind = yes
start_tls = no
bind_dn = vmail
bind_pw = *******
search_base = cn=users,dc=domaine,dc=net
scope = sub
query_filter = (&(objectClass=person)(userPrincipalName=%s))
result_attribute= userPrincipalname
result_format = %d/%u/Maildir/
debuglevel = 0
================still get this error bellow ======================
root@smail:~# postmap -q vmail@um6ss.ma ldap:/etc/postfix/ad_virtual_mailbox_maps.cf
postmap: warning: dict_ldap_lookup: Search error 10: Referral
postmap: fatal: table ldap:/etc/postfix/ad_virtual_mailbox_maps.cf: query error: Success
===============debuglevel 1 result==========================
root@smail:~# postmap -q vmail@domaine.net ldap:/etc/postfix/ad_virtual_mailbox_maps.cf
postmap: dict_ldap_debug: ldap_create
postmap: dict_ldap_debug: ldap_url_parse_ext(ldap://SERVEURAD.domaine.net:xxx)
postmap: dict_ldap_debug: ldap_sasl_bind
postmap: dict_ldap_debug: ldap_send_initial_request
postmap: dict_ldap_debug: ldap_new_connection 1 1 0
postmap: dict_ldap_debug: ldap_int_open_connection
postmap: dict_ldap_debug: ldap_connect_to_host: TCP SERVEURAD.domaine.net:xxx
postmap: dict_ldap_debug: ldap_new_socket: 4
postmap: dict_ldap_debug: ldap_prepare_socket: 4
postmap: dict_ldap_debug: ldap_connect_to_host: Trying 172.25.50.3:xxx
postmap: dict_ldap_debug: ldap_pvt_connect: fd: 4 tm: 10 async: 0
postmap: dict_ldap_debug: ldap_ndelay_on: 4
postmap: dict_ldap_debug: ldap_int_poll: fd: 4 tm: 10
postmap: dict_ldap_debug: ldap_is_sock_ready: 4
postmap: dict_ldap_debug: ldap_ndelay_off: 4
postmap: dict_ldap_debug: ldap_pvt_connect: 0
postmap: dict_ldap_debug: ldap_open_defconn: successful
postmap: dict_ldap_debug: ldap_send_server_request
postmap: dict_ldap_debug: ber_scanf fmt ({it) ber:
postmap: dict_ldap_debug: ber_scanf fmt ({i) ber:
postmap: dict_ldap_debug: ber_flush2: 29 bytes to sd 4
postmap: dict_ldap_debug: ldap_result ld 0x7f2ff896d010 msgid 1
postmap: dict_ldap_debug: wait4msg ld 0x7f2ff896d010 msgid 1 (timeout 10000000 usec)
postmap: dict_ldap_debug: wait4msg continue ld 0x7f2ff896d010 msgid 1 all 1
postmap: dict_ldap_debug: ** ld 0x7f2ff896d010 Connections:
postmap: dict_ldap_debug: * host: SERVEURAD.domaine.net port: xxx (default)
postmap: dict_ldap_debug: refcnt: 2 status: Connected
postmap: dict_ldap_debug: last used: Tue Dec 30 11:48:44 2014
postmap: dict_ldap_debug:
postmap: dict_ldap_debug: ** ld 0x7f2ff896d010 Outstanding Requests:
postmap: dict_ldap_debug: * msgid 1, origid 1, status InProgress
postmap: dict_ldap_debug: outstanding referrals 0, parent count 0
postmap: dict_ldap_debug: ld 0x7f2ff896d010 request count 1 (abandoned 0)
postmap: dict_ldap_debug: ** ld 0x7f2ff896d010 Response Queue:
postmap: dict_ldap_debug: Empty
postmap: dict_ldap_debug: ld 0x7f2ff896d010 response count 0
postmap: dict_ldap_debug: ldap_chkResponseList ld 0x7f2ff896d010 msgid 1 all 1
postmap: dict_ldap_debug: ldap_chkResponseList returns ld 0x7f2ff896d010 NULL
postmap: dict_ldap_debug: ldap_int_select
postmap: dict_ldap_debug: read1msg: ld 0x7f2ff896d010 msgid 1 all 1
postmap: dict_ldap_debug: ber_get_next
postmap: dict_ldap_debug: ber_get_next: tag 0x30 len 16 contents:
postmap: dict_ldap_debug: read1msg: ld 0x7f2ff896d010 msgid 1 message type bind
postmap: dict_ldap_debug: ber_scanf fmt ({eAA) ber:
postmap: dict_ldap_debug: read1msg: ld 0x7f2ff896d010 0 new referrals
postmap: dict_ldap_debug: read1msg: mark request completed, ld 0x7f2ff896d010 msgid 1
postmap: dict_ldap_debug: request done: ld 0x7f2ff896d010 msgid 1
postmap: dict_ldap_debug: res_errno: 0, res_error: <>, res_matched: <>
postmap: dict_ldap_debug: ldap_free_request (origid 1, msgid 1)
postmap: dict_ldap_debug: ldap_parse_result
postmap: dict_ldap_debug: ber_scanf fmt ({iAA) ber:
postmap: dict_ldap_debug: ber_scanf fmt (}) ber:
postmap: dict_ldap_debug: ldap_msgfree
postmap: dict_ldap_debug: ldap_search_ext
postmap: dict_ldap_debug: put_filter: "(&(objectClass=person)(userPrincipalName=vmail@domaine.net))"
postmap: dict_ldap_debug: put_filter: AND
postmap: dict_ldap_debug: put_filter_list "(objectClass=person)(userPrincipalName=vmail@domaine.net )"
postmap: dict_ldap_debug: put_filter: "(objectClass=person)"
postmap: dict_ldap_debug: put_filter: simple
postmap: dict_ldap_debug: put_simple_filter: "objectClass=person"
postmap: dict_ldap_debug: put_filter: "(userPrincipalName=vmail@doamine.net)"
postmap: dict_ldap_debug: put_filter: simple
postmap: dict_ldap_debug: put_simple_filter: "userPrincipalName=vmail@domaine.net"
postmap: dict_ldap_debug: ldap_send_initial_request
postmap: dict_ldap_debug: ldap_send_server_request
postmap: dict_ldap_debug: ber_scanf fmt ({it) ber:
postmap: dict_ldap_debug: ber_scanf fmt ({) ber:
postmap: dict_ldap_debug: ber_flush2: 132 bytes to sd 4
postmap: dict_ldap_debug: ldap_result ld 0x7f2ff896d010 msgid 2
postmap: dict_ldap_debug: wait4msg ld 0x7f2ff896d010 msgid 2 (timeout 10000000 usec)
postmap: dict_ldap_debug: wait4msg continue ld 0x7f2ff896d010 msgid 2 all 1
postmap: dict_ldap_debug: ** ld 0x7f2ff896d010 Connections:
postmap: dict_ldap_debug: * host: SERVEURAD.domaine.net port: xxx (default)
postmap: dict_ldap_debug: refcnt: 2 status: Connected
postmap: dict_ldap_debug: last used: Tue Dec 30 11:48:44 2014
postmap: dict_ldap_debug:
postmap: dict_ldap_debug: ** ld 0x7f2ff896d010 Outstanding Requests:
postmap: dict_ldap_debug: * msgid 2, origid 2, status InProgress
postmap: dict_ldap_debug: outstanding referrals 0, parent count 0
postmap: dict_ldap_debug: ld 0x7f2ff896d010 request count 1 (abandoned 0)
postmap: dict_ldap_debug: ** ld 0x7f2ff896d010 Response Queue:
postmap: dict_ldap_debug: Empty
postmap: dict_ldap_debug: ld 0x7f2ff896d010 response count 0
postmap: dict_ldap_debug: ldap_chkResponseList ld 0x7f2ff896d010 msgid 2 all 1
postmap: dict_ldap_debug: ldap_chkResponseList returns ld 0x7f2ff896d010 NULL
postmap: dict_ldap_debug: ldap_int_select
postmap: dict_ldap_debug: read1msg: ld 0x7f2ff896d010 msgid 2 all 1
postmap: dict_ldap_debug: ber_get_next
postmap: dict_ldap_debug: ber_get_next: tag 0x30 len 143 contents:
postmap: dict_ldap_debug: read1msg: ld 0x7f2ff896d010 msgid 2 message type search-result
postmap: dict_ldap_debug: ber_scanf fmt ({eAA) ber:
postmap: dict_ldap_debug: read1msg: ld 0x7f2ff896d010 0 new referrals
postmap: dict_ldap_debug: read1msg: mark request completed, ld 0x7f2ff896d010 msgid 2
postmap: dict_ldap_debug: request done: ld 0x7f2ff896d010 msgid 2
postmap: dict_ldap_debug: res_errno: 10, res_error: <0000202B: RefErr: DSID-0310082F, data 0, 1 access points??ref 1: 'domaine.net'?>, res_matched: <>
postmap: dict_ldap_debug: ldap_free_request (origid 2, msgid 2)
postmap: dict_ldap_debug: ldap_parse_result
postmap: dict_ldap_debug: ber_scanf fmt ({iAA) ber:
postmap: dict_ldap_debug: ber_scanf fmt (v) ber:
postmap: dict_ldap_debug: ber_scanf fmt (}) ber:
postmap: dict_ldap_debug: ldap_err2string
postmap: warning: dict_ldap_lookup: Search error 10: Referral
postmap: dict_ldap_debug: ldap_free_connection 1 1
postmap: dict_ldap_debug: ldap_send_unbind
postmap: dict_ldap_debug: ber_flush2: 7 bytes to sd 4
postmap: dict_ldap_debug: ldap_free_connection: actually freed
postmap: dict_ldap_debug: ldap_msgfree
postmap: fatal: table ldap:/etc/postfix/ad_virtual_mailbox_maps.cf: query error: Success
============the account vmail exist in ldapsearch ===============
# vmail vmail, Users, domaine.net
dn: CN=vmail vmail,CN=Users,DC=domaine,DC=net
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
cn: vmail vmail
sn: vmail
givenName: vmail
distinguishedName: CN=vmail vmail,CN=Users,DC=domaine,DC=net
instanceType: 4
whenCreated: 20141225111508.0Z
whenChanged: 20141230095803.0Z
displayName: vmail
uSNCreated: 29673
memberOf: CN=Administrateurs,CN=Builtin,DC=domaine,DC=net
uSNChanged: 32933
name: vmail vmail
objectGUID:: TXgWCkMHpEqyamE9uFeFDQ==
userAccountControl: 66048
badPwdCount: 0
codePage: 0
countryCode: 0
badPasswordTime: 130644063807298743
lastLogoff: 0
lastLogon: 130644063977028034
pwdLastSet: 13063979454598091
primaryGroupID: 513
userParameters:: bTogICAgICAgICAgICAgICAgICAgIGQBICAgICAgICAgICAgICAgICAgICAgI
CAg
objectSid:: AQUAAAAAAAUVAAAA34k6kpUwbW6uzm2pXQQAAA==
adminCount: 1
accountExpires: 9223372036854775807
logonCount: 15
sAMAccountName: vmail
sAMAccountType: 805306368
userPrincipalName: vmail@domaine.net
objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=domaine,DC=net
dSCorePropagationData: 20141230095803.0Z
dSCorePropagationData: 20141229131228.0Z
dSCorePropagationData: 20141229122740.0Z
dSCorePropagationData: 20141225112301.0Z
dSCorePropagationData: 16010101000000.0Z
lastLogonTimestamp: 130639812982395941
msDS-SupportedEncryptionTypes: 0
mail: vmail@domaine.net
======================================================
using ad_sender_maps & ad_virtual_group_maps , i think every thing looks ok by getting the correct results
=======================================================
Regards