Retrieving a List of Aliases Using a Database Query

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
Ilya
Posts: 3
Joined: Thu Apr 15, 2021 4:11 am

Retrieving a List of Aliases Using a Database Query

Post by Ilya »

What query in the database can you get a list of aliases?
Zimbra 8.8.15

I am aware of the capabilities of zmprov. BUT, due to the number of users (about 4000) and a specific task, using zmprov we get the required list in about 2 hours.


For example, we get a list of e-mails with a request to the zimbra database in 0.01 seconds:
select comment from mailbox order by comment;

:geek:
Last edited by Ilya on Thu Apr 15, 2021 5:18 pm, edited 1 time in total.
7224jobe
Outstanding Member
Outstanding Member
Posts: 283
Joined: Sat Sep 13, 2014 1:55 am
ZCS/ZD Version: 8.8.15_FOSS Patch38

Re: Retrieving a List of Aliases Using a Database Query

Post by 7224jobe »

I think that the information you are looking for can be found in Zimbra LDAP, if you do not want to use zmprov. Take a look here: https://wiki.zimbra.com/wiki/Zimbra_Dir ... ice_(LDAP) and here https://wiki.zimbra.com/wiki/ShanxT-LDAP-CheatSheet .
Ilya
Posts: 3
Joined: Thu Apr 15, 2021 4:11 am

Re: Retrieving a List of Aliases Using a Database Query

Post by Ilya »

Some problem, I don't understand where my message disappeared ...

I need information on how I can get a list of aliases by a database query. This will speed up the solution in my situation by several hundred times compared to the zmprov command.

For example, I can get a list of mailboxes using a database query. But I can't find a table in the database that has information about aliases :(
User avatar
ccelis5215
Outstanding Member
Outstanding Member
Posts: 632
Joined: Sat Sep 13, 2014 2:04 am
Location: Caracas - Venezuela
ZCS/ZD Version: 8.8.15.GA.3869.UBUNTU18.64 P12

Re: Retrieving a List of Aliases Using a Database Query

Post by ccelis5215 »

Ilya wrote:Some problem, I don't understand where my message disappeared ...

I need information on how I can get a list of aliases by a database query. This will speed up the solution in my situation by several hundred times compared to the zmprov command.

For example, I can get a list of mailboxes using a database query. But I can't find a table in the database that has information about aliases :(
Hi, your question was answered by 7224jobe, anyways:

as zimbra user:

Code: Select all

ldapsearch -x -D `zmlocalconfig -m nokey -s zimbra_ldap_userdn` -w `zmlocalconfig -m nokey -s zimbra_ldap_password` -h `hostname -f` '(&(objectclass=zimbraAccount)(zimbraMailDeliveryAddress=*)(zimbraMailAlias=*)(!(zimbraIsSystemAccount=TRUE))(!(zimbraIsAdminAccount=TRUE))(!(objectclass=zimbraCalendarResource)))' zimbraMailDeliveryAddress displayName zimbraMailAlias
Hope it helps.

ccelis
Ilya
Posts: 3
Joined: Thu Apr 15, 2021 4:11 am

Re: Retrieving a List of Aliases Using a Database Query

Post by Ilya »

All right! Thank you!
Post Reply