1

I have become dependent on Zimbra, and yet I have no need for a heavy GUI administrative interface. I'd rather keep a low-resource server that runs only the underlying services Zimbra uses, such as postfix and Courier.

But is it possible to extract the existing accounts from Zimbra, including authentication credentials, accounts and aliases, distribution lists, etc -- to run the same servers a la carte, without the Zimbra "suite" involved?

If so, what are the steps to do a SMTP/IMAP account migration such as this?

1 Answers1

3

But is it possible to extract the existing accounts from Zimbra including authentication credentials, accounts and aliases, distribution lists, etc -- to run the same servers a la carte, without the Zimbra "suite" involved?

YES

First task that you needs was parsing zimbra LDAP data extracted with this command (taken from this page)

/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}'` $*
  • All email address listed in dn
  • All password listed in userPassword. You need to base64-decode it. Zimbra use LDAP to verify password, so the expected hash is same with RFC 2307 hashed passwords.
  • All available aliases was listed in zimbraMailAlias
  • All distribution list was listed in all account with objectClass: zimbraDistributionList. The member can be retrieved from zimbraMailForwardingAddress.

The last one (distribution list) can be substituted with command zmprov gadl and zmprov gdl listname@example.com. See zimbra wiki.

Another step is ensure that courier and postfix backend to understand the password hash from zimbra.


Another way is setup LDAP and export zimbra LDAP to new LDAP. Postfix must be configured so it match zimbra configuration.

[zimbra@mbox ~]$ postconf -n | grep ldap
sender_canonical_maps = proxy:ldap:/opt/zimbra/conf/ldap-scm.cf
transport_maps = proxy:ldap:/opt/zimbra/conf/ldap-transport.cf
virtual_alias_domains = proxy:ldap:/opt/zimbra/conf/ldap-vad.cf
virtual_alias_maps = proxy:ldap:/opt/zimbra/conf/ldap-vam.cf,hash:/home/mailman/maps/virtual_aliases
virtual_mailbox_domains = proxy:ldap:/opt/zimbra/conf/ldap-vmd.cf
virtual_mailbox_maps = proxy:ldap:/opt/zimbra/conf/ldap-vmm.cf

Courier also can be configured to use LDAP backend.

masegaloeh
  • 17,978
  • 9
  • 56
  • 104
  • I wish I could vote this up 10x for use of `awk` alone. This ray of hope that I can free my accounts from zimbra is awesome. Extra awesome about the two different ways. I will begin looking into this and come back with my progress and accept the answer once it works. – digitalextremist Mar 26 '15 at 09:40
  • The answer above was general one. The real challenge is parsing the LDAP data so its match your needs.Of course this is no problem if you already have experience building script to parsing LDAP search result :) – masegaloeh Mar 26 '15 at 09:45