Topic: List all domains

I just installed the iredmail server and I really like it!

Our domain registry does have a backup/relay mail server in case our mailserver is down.
For this they need a url with an plain-text file of all the mail domains on my server.

How can I query postfix/ldap/iredmail for a simple list of all domains? Anyone an idea for that?
Is there a command to run?



Re: List all domains

You can use OpenLDAP client tool "ldapsearch" to get all domains.


# ldapsearch -x -s one -D 'cn=vmail,dc=iredmail,dc=org' -b 'o=domains,dc=iredmail,dc=org' -W "(objectClass=mailDomain)" domainName

You have to replace "cn=vmail,dc=iredmail,dc=org" and "o=domains,dc=iredmail,dc=org" here, and you can find them in /etc/postfix/ldap_*.cf (bind_dn, search_base).

For more information, please read manual page of 'ldapsearch':

# man ldapsearch


Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee


Re: List all domains

Thanks a lot for the quick reply, all sorted out now smile
No experience whatsoever with Ldap, but this pointed me to the right direction..