msgbartop
A cronological documentation test project, nothing serious, really!
msgbarbottom

02 Feb 2008 ReIndexing a Zimbra mailbox

I had some problems with one of my mailaccounts periodically not receiving mail. A temporary way to fix it was to restart zimbra as zimbra user (zmcontrol stop; zmcontrol start; ) It worked for a while, but came back usually after a couple of hours.

The solution to this problem was to reindex the mailaccount as zimbra user.

# su - zimbra
# zmprov rim username@example.com start
# zmprov rim username@example.com status

Tags: , ,

Posted by

01 Feb 2008 Cold backup for the Open Source Edition of Zimbra

Today I’ve setup a cold backup routine to backup my Zimba installation running on my Debian (Etch) 4.0 server that is in full production now for my private domains. This is a slightly modified backup script for the Open Source Edition of Zimbra from the Zimbra Wiki. Please note that the script does a full backup every time it’s being run!

#!/bin/bash

# Zimbra Backup Script
# Requires sftp to run
# This script is intended to run from the crontab as root
# Free to use and free of any warranty!  Daniel W. Martin, 9 Sept 2007

# Live sync before stopping Zimbra to minimize sync time with the services down
# Comment out the following line if you want to try single cold-sync only
rsync -avHK --delete /opt/zimbra/ /backup/zimbra

# which is the same as: /opt/zimbra /backup
# Including --delete option gets rid of files in the dest folder that don't exist at the src
# this prevents logfile/extraneous bloat from building up overtime.

# Stop Zimbra Services
sudo -u zimbra /opt/zimbra/bin/zmcontrol stop
sleep 40

# Sync to backup directory
rsync -avHK --delete /opt/zimbra/ /backup/zimbra

# Restart Zimbra Services
sudo -u zimbra /opt/zimbra/bin/zmcontrol start

# Create a txt file in the backup directory that'll contain the current Zimbra
# server version. Handy for knowing what version of Zimbra a backup can be restored to.
sudo -u zimbra zmcontrol -v > /backup/zimbra/conf/zimbra_version.txt
# or examine your /opt/zimbra/.install_history

# Create archive of backed-up directory for offsite transfer
# cd /backup/zimbra
ZimbraVersion=zimbraBackup-zcs-5.0.1_GA_1902.DEBIAN4.0.20080109200914

tar -zcf /backup/$ZimbraVersion-$(date +"%Y-%m-%d").tgz -C /backup/zimbra .

# Transfer file to backup server using passwordless sftp
scp zimbraBackup-zcs-5.0.1_GA_1902.DEBIAN4.0.20080109200914-$(date +"%Y-%m-%d").tgz username@example.com:/path/to/backupfolder/

I’ve described passwordless ssh/sftp session in a earlier post so I won’t describe the last line of the backup script.

Tags: , , , , ,

Posted by

30 Jan 2008 Installing Zimbra on Debian 4.0 (Etch)

This post describes most of the steps I did to make a clean install of the open source edition of Zimbra on a little Debian test server including importing e-mail from a Dovecot IMAP-server.

Downloaded the Debian 4 installer from the Open Source Edition Downloads page.
Unpacked it and started the installer as root

tar xfz zcs-5.0.0_GA_1869.DEBIAN4.0.20071218200820.tgz
cd zcs-5.0.0_GA_1869.DEBIAN4.0.20071218200820
./install.sh

The Zimbra installer checked my system to see if there was an existing installation.
Then it checked for prerequisites and reported the following packages was missing

NPTL...FOUND
sudo...FOUND
libidn1l...FOUND
fetchmail...MISSING
libgmp3c2...MISSING
libxml2...FOUND
libstdc++6...FOUND
openssl...FOUND
libltdl3...MISSING

The installation was cancelled and I had to install the needed packages to continue

apt-get install fetchmail libgmp3c2 libltdl3

Started the install again and now all prerequisites was found.
The installer showed med the following installable packages

zimbra-core
zimbra-ldap
zimbra-logger
zimbra-mta
zimbra-smtp
zimbra-store
zimbra-apache
zimbra-spell
zimbra-proxy

I chose to install all but the zimbra-proxy package.
The installer crashed because the curl package was missing on my system. Installed it

apt-get install curl

and restarted the installer. The installer finished the without further problems.

Importing e-mail messages from my old IMAP server running Dovecot
To import from my old IMAp server I downloaded the imapsync script from http://www.linux-france.org/prj/imapsync/ unpacked it and typed in

./imapsync --syncinternaldates --ssl1 --user1 myOldUser --password1 mySecretPassword --host1 fromMailServer --authmech1 PLAIN --ssl2 --user2 myNedUser@example.com --password2 MyNewSecretpassword --host2 toMailServer.com   --authmech2 LOGIN

I had to install the following packages to run the imapsync script

apt-get install libmail-imapclient-perl
apt-get install libdate-manip-perl

This enabled import of my mail using SSL connection from port 993 on my old mail server to my Zimbra mail server.

I had some problems importing bil mail so I had to increase the mailsize limit from 10MB to 50MB to import all messages. Doing this as user zimbra

zmprov mcf zimbraFileUploadMaxSize 50000000

The Zimbra Administration console is only available from the server itself, that’s why I couldn’t see port 7071 from the Internet. The console is available from https://example.com:7071/zimbraAdmin

Basic usage
These commands can be run as the zimbra user
Stop zimbra

su - zimbra
zmcontrol stop

Start zimbra

zmcontrol start

Running zimbra apache on another port than port 80.
As zimbra user

zmprov ms  zimbraMailPort 8080

This makes it possible to run my own Apache server for my virtual domains.

Running another mysql server
I’ve changed the socket configuration for mysql to have another instance of it running.
Command to login to the mysql console

mysql -p -S /var/run/mysqld/mysqld2.sock

Tags: , , , ,

Posted by

24 Jan 2008 Share calendar between Zimbra users

This post describes how to create shared calendars between two users in Zimbra 5.0

In this example, the administrator designates a mount point to userA@example.com for the calendar to  userB@example.com account for which he will have read/write permissions.

As user zimbra do the following

zmmailbox
mbox> adminAuthenticate -u https://server.example.com:7071 admin@example.com password
mbox> selectMailbox userB@example.com
mailbox: userB@example.com, size: 1.44 GB, messages: 20868, unread: 2564

getAllFolders        Id  View      Unread   Msg Count  Path
----------  ----  ----------  ----------  ----------
         1  conv           0           0  /
        10  appo           0           0  /Calendar
        14  mess           0           0  /Chats
         7  cont           0           0  /Contacts
       720  mess           0           0  /Deleted Messages
         6  mess           0           0  /Drafts
         2  mess          11        1010  /Inbox
       901  conv           0           0  /Journal
         4  mess           0           0  /Junk
       900  conv           0           0  /Outbox
         5  mess           0           0  /Sent
        15  task           0           0  /Tasks
         3  conv           0           0  /Trash
mbox userB@example.com>getFolderGrant /Calendar

Permissions    Type  Display
-----------  ------  -------
      false        rwidx  accoun  null
mbox userB@example.com>modifyFolderGrant /Calendar account userA@example.com rw
mbox userB@example.com>gfg /Calendar
Inherit  Permissions    Type  Display
-------  -----------  ------  -------
  false        rwidx  accoun  null
  false           rw  accoun  userA@example.com
mbox userB@example.com>selectMailbox userA@example.com
mailbox: userA@example.com, size: 1.12 GB, messages: 5400, unread: 860
mbox userB@example.com>createMountpoint --view appointment /userB-calendar userB@example.com /Calendar

userA@example.com should now see the calendar to userB@example.com as userB-calendar in the Calendar view.

Tags: , , , , , , , ,

Posted by

20 Jan 2008 Exporting and importing Zimbra LDAP data

The reasons can vary from an emergency restore of user accounts, to changing system architecture. In this Administrator’s PowerTip we will discuss how to export(dump) LDAP data to disk, and re import it.

Dumping LDAP Data to Disk
Exporting the data will place all of your LDAP Data into a single, movable .LDIF file.

su - zimbra
openldap/sbin/slapcat -f /opt/zimbra/conf/slapd.conf -l /tmp/ldap.ldif

Removing Current LDAP Data
WARNING!
DO NOT perform this on a production system. This procedure will wipe all usernames and passwords!

In order to import the LDAP data that we have exported, you will need to remove the current ldap data on the system.

su - zimbra
zmcontrol stop
ps auxx | grep slapd
(If ldap is still running, kill it)
rm -f openldap-data/*

Importing LDAP Data

su - zimbra
openldap/slapadd -f /opt/zimbra/conf/slapd.conf -l /tmp/ldap.ldif

Verify It’s Working

openldap/slapcat -f /opt/zimbra/conf/slapd.conf

or

zmprov gaa

These instructions have been testet successfully on my Zimbra 5.0 installation.

Source: http://www.zimbra.com/blog/

Tags: , , , ,

Posted by