0

I have a working installation on Ubuntu 14.04 openVZ container of Zimbra Collaboration 8.6.0 Open Source edition. It works great and I've already set a daily full backup of the entire mail server/container (Let us say at 5:00 am) and with the latter I'm able to completely restore the server (at 5:00 am status).

Now, however, I'd use rsync to keep a synchronized per second copy of all the emails , accounts and domains present (so not a copy of the entire server) but I was not able to locate the files containing the data (emails, accounts, domains...).

Where are located? Are they saved in a database? What's the path of these files? /opt/zimbra/...?

atazmak
  • 49
  • 1
  • 6

3 Answers3

1

Each zimbra item is composed of 2 entities, metadata and blob, metadata is stored in database mboxgroup{mailbox_id % 100}.mail_item as an encoded dictionary (in zimbra format), it contains object id, subject, folderId, name, contact fields, etc.. Each item can have also a related blob, like an email will have its raw mime, a contact may have a mime which contains contact image and so on, those are stored in zimbra store as simple files.

Account, Cos, Domains are stored in ldap.

davide
  • 316
  • 2
  • 9
0

all messages are stored as unique blob in a "store/" filesystem, then pointed at with the help off metadata in Mysql database.

you need first to know what is the database corresponding to your mailbox:

(as zimbra user)

for U in $(zmprov -l gaa);do echo $U;zmprov getMailboxInfo $U;done

mailboxid give you the database number of the user: then connect to this database.

mysql mboxgroup5
mysql> select id, 
    concat('/opt/zimbra/store/', (mailbox_id >> 12), '/', mailbox_id, '/msg/',
    (id % (1024*1024) >> 12), '/', id, '-', mod_content, '.msg') as file
    from mail_item where mailbox_id=5 limit 1;

id = message number

echo "select id,concat('/opt/zimbra/store/', (mailbox_id >> 12), '/', mailbox_id, '/msg/',(id % (1024*1024) >> 12), '/', id, '-', mod_content, '.msg') as file, metadata from mail_item where mailbox_id=5 and id > 200 and id < 300"|mysql mboxgroup5 

with this line you have the messages as file that are linked to your mailbox_id

dominix
  • 273
  • 1
  • 13
0

FYI, In a large zimbra installation with many mailstores/large amount or mailboxes, the mboxgroup id is going to differ.

$ zmprov getMailboxInfo b@test.test
mailboxId: 5247
quotaUsed: 1951021

$ expr 5247 % 100
47

$ mysql mboxgroup47
Pang
  • 9,564
  • 146
  • 81
  • 122
khondhu
  • 36
  • 1