kolab2.example.org refers to the Kolab 2 server, kolab3.example.org refers to the Kolab 3 server.
kolab2.example.org:
# /kolab/bin/openpkg rc stop all
kolab2.example.org.
kolab3.example.org:
# service cyrus-imapd stop
kolab3.example.org:
# service kolabd stop
/etc/kolab/kolab.conf. The following settings are important:
primary_mail setting in the [$domain] section.
user_types as per the instructions in Section 5.1, “Editing user_types”.
secondary_mail setting in the [$domain] section.
primary_mail setting already have been disabled.
mail attribute value of "givenname"."surname"@example.org. The recipient policy must therefore be adjusted.
[example.org] section in /etc/kolab/kolab.conf, the primary_mail setting must be adjusted to match the "surname"@example.org convention:
(...snip...) [example.org] primary_mail = %(surname)s@%(domain)s (...snip...)
mail attribute value of "surname"@example.org assigned.
mail attribute value of doe@example.org, but should you have a Jane Doe as well, she would get doe2@example.org. It is therefore important to add users in order.
kolab3.example.org to execute the steps in this procedure.
/kolab/var/imapd/ on your Kolab 2 server.
#scp root@kolab2.example.org:/kolab/var/imapd/annotations.db \>/var/lib/imap/annotations.db(...) #scp root@kolab2.example.org:/kolab/var/imapd/mailboxes.db \>/var/lib/imap/mailboxes.db(...)
#rsync -rltpHvz --progress --partial \>kolab2.example.org:/kolab/var/imapd/spool/ \>/var/spool/imap/(...)
#rsync -rltpHvz --progress --partial \>kolab2.example.org:/kolab/var/imapd/domain/ \>/var/lib/imap/domain/(...) #rsync -rltpHvz --progress --partial \>kolab2.example.org:/kolab/var/imapd/user/ \>/var/lib/imap/user/(...)
# chown -R cyrus:mail /var/lib/imap/ /var/spool/imap/
#find /var/lib/imap -type f -exec chmod 640 {} \;#find /var/lib/imap -type d -exec chmod 750 {} \;#find /var/spool/imap -type f -exec chmod 640 {} \;#find /var/spool/imap -type d -exec chmod 750 {} \;
#!/bin/bash find /var/lib/imap/ -type f -name "*.seen" | \ sort | while read seendb; do /usr/lib/cyrus-imapd/cvt_cyrusdb ${seendb} skiplist ${seendb}.txt flat mv ${seendb} ${seendb}.orig /usr/lib/cyrus-imapd/cvt_cyrusdb ${seendb}.txt flat ${seendb} skiplist chown cyrus:mail ${seendb} ${seendb}.txt ${seendb}.orig done
# service kolabd stop
kolab3.example.org:
# service cyrus-imapd start
#mkdir -p /var/lib/imap/log/cyrus-admin#chown cyrus:mail /var/lib/imap/log/cyrus-admin
#!/bin/bash kolab lm | while read folder; do echo ". SELECT \"${folder}\"" done | \ imtest -t "" \ -u ${cyrus_admin} \ -a ${cyrus_admin} \ -w "${cyrus_admin_pw}" \ ${imap_host}
#!/bin/bash . ./settings.sh echo '. LIST "" "*"' | \ imtest \ -t "" \ -u ${cyrus_admin} \ -a ${cyrus_admin} \ -w "${cyrus_admin_pw}" \ ${imap_host} | \ sed -r \ -e '/^\* LIST/!d' \ -e 's/.*\"\/\"\s(.*)/\1/g' \ -e 's/^"//g' \ -e 's/"$//g' \ -e 's/\s*\r*\n*$//g' | \ while read folder; do echo ". SELECT \"${folder}\"" done | \ imtest -t "" \ -u ${cyrus_admin} \ -a ${cyrus_admin} \ -w "${cyrus_admin_pw}" \ ${imap_host}
/var/log/maillog:
Aug 8 16:40:10 kolab imap[4644]: Index upgrade: example.org!shared.lists.example^org.memo (10 -> 12) Aug 8 16:40:10 kolab imap[4644]: seen_db: user cyrus-admin opened /var/lib/imap/user/c/cyrus-admin.seen
#kolab -c conf/kolab-kolab2.example.org.conf \>list-mailbox-metadata "user/john.doe/Calendar*@example.org"Folder user/john.doe/Calendar@example.org /shared/vendor/cmu/cyrus-imapd/lastpop /shared/vendor/cmu/cyrus-imapd/partition default /shared/vendor/cmu/cyrus-imapd/lastupdate 8-Aug-2012 16:16:06 +0200 /shared/vendor/cmu/cyrus-imapd/size 266564 /shared/vendor/cmu/cyrus-imapd/pop3newuidl true /shared/vendor/cmu/cyrus-imapd/sharedseen false /shared/vendor/kolab/folder-type event.default /shared/vendor/cmu/cyrus-imapd/condstore true /shared/vendor/cmu/cyrus-imapd/duplicatedeliver false /shared/vendor/kolab/incidences-for admins /shared/vendor/kolab/folder-test true Folder user/john.doe/Calendar/Private@example.org /shared/vendor/cmu/cyrus-imapd/lastpop /shared/vendor/cmu/cyrus-imapd/partition default /shared/vendor/cmu/cyrus-imapd/lastupdate 8-Aug-2012 16:08:58 +0200 /shared/vendor/cmu/cyrus-imapd/condstore true /shared/vendor/cmu/cyrus-imapd/pop3newuidl true /shared/vendor/cmu/cyrus-imapd/size 305426 /shared/vendor/cmu/cyrus-imapd/sharedseen false /shared/vendor/kolab/folder-type event /shared/vendor/cmu/cyrus-imapd/duplicatedeliver false #kolab list-mailbox-metadata "user/john.doe/Calendar*@example.org"Folder user/john.doe/Calendar@example.org /shared/vendor/cmu/cyrus-imapd/lastpop /shared/vendor/cmu/cyrus-imapd/partition default /shared/vendor/cmu/cyrus-imapd/lastupdate 8-Aug-2012 16:16:27 +0200 /shared/vendor/cmu/cyrus-imapd/duplicatedeliver false /shared/vendor/cmu/cyrus-imapd/pop3newuidl true /shared/vendor/cmu/cyrus-imapd/size 266564 /shared/vendor/cmu/cyrus-imapd/sharedseen false /shared/vendor/kolab/folder-type event.default Folder user/john.doe/Calendar/Private@example.org /shared/vendor/cmu/cyrus-imapd/lastpop /shared/vendor/cmu/cyrus-imapd/partition default /shared/vendor/cmu/cyrus-imapd/lastupdate 8-Aug-2012 16:27:44 +0200 /shared/vendor/cmu/cyrus-imapd/duplicatedeliver false /shared/vendor/cmu/cyrus-imapd/pop3newuidl true /shared/vendor/cmu/cyrus-imapd/size 305426 /shared/vendor/cmu/cyrus-imapd/sharedseen false
#!/bin/bash # Interesting Annotations declare -a ia ia[${#ia[@]}]="/shared/vendor/kolab/folder-type" ia[${#ia[@]}]="/shared/vendor/kolab/folder-test" for folder_search in user/*@example.org shared/*@example.org; do kolab -c conf/kolab-kolab.kolabsys.com.conf \ list-mailbox-metadata "${folder_search}" | \ while read line; do if [ ! -z "$(echo $line | grep ^Folder)" ]; then current_folder=$(echo $line | cut -d' ' -f2-) echo "Folder: '${current_folder}'" else annotation_key=$(echo $line | awk '{print $1}') annotation_value=$(echo $line | awk '{print $2}') i=0 set_annotation=0 while [ $i -lt ${#ia[@]} ]; do if [ "${ia[$i]}" == "${annotation_key}" ]; then set_annotation=1 break fi let i++ done if [ ${set_annotation} -eq 0 ]; then continue fi echo "Setting ${annotation_key} to ${annotation_value}" kolab set-mailbox-metadata \ "${current_folder}" \ "${annotation_key}" \ "${annotation_value}" fi done done
kolab-formatupgrade. This command is run in two parts. The first will upgrade all mailbox contents in the personal namespace:
#kolab lm "user/%@example.org" | \>sed -e 's/user\///g' | \>while read user; do>kolab-formatupgrade \>--user "${user}" \>--password>$password\--proxyauth cyrus-admin \>--port 143 \>--encrypt TLS \>>localhostdone
cyrus-admin normally does not have the necessary privileges to insert new messages into mail folders, so we're going to have to give out the rights first. We'll delete them again afterwards.
#kolab sam shared/*@example.org cyrus-admin lrswiptexa#kolab lm shared/*@example.org | \>while read folder; do>kolab-formatupgrade \>--user cyrus-admin \>--password>$password\--port 143 \>--encrypt TLS \>--folder "${folder}" \>>localhostdone#kolab dam shared/*@example.org cyrus-admin
mail attribute values for all users - and therefore mailbox names, and ACL entry subject validity