Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-29-2008, 09:43 AM
Active Member
 
Posts: 44
Default [SOLVED] Getting a list of aliases

Hello everyone!

I'd like to find a way, using the CLI, to get a list of aliases and the mailbox associated to each alias. Same with distribution lists, but the most important thing for me is aliases.

The closest thing I've found so far is this:

Exporting all addresses - Zimbra :: Wiki

But it does not make a difference, and I am looking for the aliases list only. Then, separated, the distribution lists. For the email addresses I use this:

zmprov getAllAccounts

Thanks.
__________________
Jaume Sabater
http://linuxsilo.net/

"Ubi sapientas ibi libertas"
Reply With Quote
  #2 (permalink)  
Old 10-29-2008, 09:55 AM
Moderator
 
Posts: 6,237
Default

See this thread:
http://www.zimbra.com/forums/etc/199...alias-etc.html
Reply With Quote
  #3 (permalink)  
Old 10-29-2008, 09:59 AM
Moderator
 
Posts: 6,237
Default

Quote:
Originally Posted by jsabater View Post
I am looking for the aliases list only.
Code:
zmprov gaa -v | grep -e zimbraMailAlias | awk '{print$2}' > aliases.txt
Quote:
Originally Posted by jsabater View Post
Then, separated, the distribution lists.
Code:
zmprov gadl > alllists.txt

Last edited by mmorse; 10-29-2008 at 10:01 AM..
Reply With Quote
  #4 (permalink)  
Old 10-31-2008, 04:06 AM
Active Member
 
Posts: 44
Default

Thanks for your help, mmorse. Here you are what I did in the end in order to have an output in the form of the /etc/aliases file (just as an example, not that I want a copy of that file or a substitute of it):

Code:
zmprov getAllAccounts -v |
    grep -e name -e zimbraMailAlias |
    awk '{
        if (/^# name/) {
            name=$3
        } else if (/^zimbraMailAlias/) {
            print $2 ": " name
        }
    }'
I think that this output is easy enough to parse from a Perl script or similar.

Bye!
__________________
Jaume Sabater
http://linuxsilo.net/

"Ubi sapientas ibi libertas"
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.