Topic: Empty postmap query when searchin otherMailbox attibute

- iRedMail version (check /etc/iredmail-release): 1.6.2 OPENLDAP edition.
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Debian 11
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP (Active Directory Windows Server 2016)
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? - No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.

Hi, I have successfully installed iRedMail and integrated it with Active Directory. I'm tring to use AD attribute "otherMailbox" to setup multiple aliases, but postmap query always return empty result. I have tried to use the same query with "Users and computers" snap-in and it works. It looks like postmap query cannot search multi-value attributes? Here is my alias config:

server_host       =
server_port       = 3268
version              = 3
bind                  = yes
start_tls            = no
bind_dn            = cn=vmail,cn=users,dc=example,dc=local
bind_pw            = *******
search_base      = dc=example,dc=local
scope                = sub
debuglevel        = 0
query_filter       = (&(objectClass=user)(otherMailbox=%s))
result_attribute = userPrincipalName

I have also tried proxyAddresses , but without any result. Everything seems to be ok when searching singiel-value attributes.
Can any one help me to resolve this issue ?

Best regards,


Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.


Re: Empty postmap query when searchin otherMailbox attibute

Try to search with ldap command line tool with same filter.


Re: Empty postmap query when searchin otherMailbox attibute

ldapsearch command works properly.


Re: Empty postmap query when searchin otherMailbox attibute

Please find attached listing from ldapsearch, postmap query and content of my ad_virtual_aliases_maps.cf file.

Post's attachments

ad_virtual_alias_maps.cf.PNG 10.84 kb, file has never been downloaded. 

ldapsearch.txt 2.68 kb, 3 downloads since 2023-03-26 

postmap_query.txt 6.48 kb, 1 downloads since 2023-03-26 

You don't have the permssions to download the attachments of this post.


Re: Empty postmap query when searchin otherMailbox attibute

Bind dn used in command line and postmap are different.
Please use the same bind dn & password as in *.cf file.


Re: Empty postmap query when searchin otherMailbox attibute

I finally found the solution! Problem with Active Directory is that it uses port 3268, wich is Global Catalog port! So, not every attribute is avalieble! Including otherMailbox, proxyAddresses and so on...
It took me a while to solve this, but I've found this script:

ldapFilter = "(&(objectClass=attributeSchema)(isMemberOfPartialAttributeSet=TRUE))"

Set rootDSE = GetObject("LDAP://rootDSE")
schemaDN = rootDSE.Get("schemaNamingContext")

Set ado = CreateObject("ADODB.Connection")
ado.Provider = "ADSDSOObject"
ado.Open "ADSearch"
Set objectList = ado.Execute("<LDAP://" & schemaDN & ">;" & ldapFilter & ";lDAPDisplayName;subtree")

While Not objectList.EOF
    attrName = objectList.Fields("lDAPDisplayName")
    WScript.Echo attrName


Script works and shows wich attribute is avalible from GC port.
I hope this information helps someone :-)