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 12-03-2007, 10:03 AM
Junior Member
 
Posts: 6
Default auto-provision mailboxes in postini service

we've now been running zimbra 4.5.5 on opensuse10.2-x86-32 for a while and been very happy with it.

we've now made it our primary mail system, using Postini as a filtering and backup-mx service. we have set up the postini account so that it knows all the valid recipients which improves spam rejection.

postini provide tools for automatically provisioning mailboxes, however, I've not found anything for doing this from zimbra.

So, I have started writing a script thus:
(
/opt/zimbra/bin/zmprov gaa
/opt/zimbra/bin/zmprov gadl
) | sort > recipients.txt


the problem is there seems to be no tool for getting lists of aliases. Now, I could use this command to get a list of email addresses:
zmprov sg mydomain mydomain | grep ^email | awk '{print$2}'
but this won't list any mailboxes that are hidden in the GAL.

please can someone give me a few hints for this?

thanks
Paul
Reply With Quote
  #2 (permalink)  
Old 12-03-2007, 10:10 AM
Outstanding Member
 
Posts: 708
Default

I don't know a resonable zmprov or zmmailbox command for that, but aliases are in LDAP.

rootsearch 'zimbraMailAlias=*' zimbraMailAlias|grep zimbraMailAlias|awk '{print $2}'

where rootsearch is

Code:
#!/bin/sh
/opt/zimbra/openldap/bin/ldapsearch -LLL -x -D"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_userdn|awk '{print $3}'`" -w"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_password|awk '{print $3}'`" -H `/opt/zimbra/bin/zmlocalconfig ldap_url|awk '{print $3}'` $*
Reply With Quote
  #3 (permalink)  
Old 12-03-2007, 10:38 AM
Junior Member
 
Posts: 6
Default

thanks for that... eek, the output is a bit raw... so here's my scriptlet to extract the right things.

Code:
DOMAIN='@example.com'
/opt/zimbra/openldap/bin/ldapsearch -LLL -x -D"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_userdn | \
    awk '{print $3}'`" -w"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_password    | \
    awk '{print $3}'`" -H `/opt/zimbra/bin/zmlocalconfig ldap_url   |   \
    awk '{print $3}'` $*    | \
    grep ^mail              | \
    grep "$DOMAIN"          | \
    awk '{print $2}'        | \
    sort
This definitely does get all the valid recipients (note, I put the '@' in the domain grep because we also use subdomains - e.g. fred@test.example.com for testing), so now I'll have a go at postini auto-prov hacking.

cheers
Paul

Last edited by speculatrix; 12-03-2007 at 10:43 AM..
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.