Talk:Zarafa

From SME Server
Revision as of 15:38, 28 September 2008 by Snoble (talk | contribs) (→‎Issues: Store_attachment)
Jump to navigation Jump to search

Rough Guide to get Zarafa running. Lots more to do...

http://forums.contribs.org/index.php?topic=42118.0

Download & Install

http://www.zarafa.com/download-community

Distribution = Rhel 4

tar -zxvf zarafa-6.20-rhel4-i386.tar.gz
yum localinstall libvmime*.rpm libical*.rpm zarafa-6*.rpm zarafa-webaccess-6*.rpm

Create the Database

mysqladmin create zarafa
mysql -e "grant all privileges on zarafa.* to zarafa@localhost identified by 'yourpassword'"
mysql -e "flush privileges"

Zarafa config files

nano /etc/zarafa/server.cfg
 mysql_user = zarafa
 mysql_password = 'yourpassword'
 mysql_database = zarafa

 user_plugin        = unix
 user_plugin_config = /etc/zarafa/unix.cfg
nano /etc/zarafa/unix.cfg
 default_domain = yourserver.net
 min_user_uid = 5000
 min_group_gid = 5000
nano /etc/zarafa/gateway.cfg [optional]
 pop3_enable     =       no
 pop3s_enable    =       no
 imap_enable     =       yes
 imap_port       =       144
 imaps_enable    =       no

SME templates

httpd.conf

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
nano /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/86ZarafaAlias
 Alias /zarafa /var/www/html/webaccess/
 <Directory /var/www/html/webaccess/>
  Options -Indexes
  AllowOverride None
  order allow,deny
  allow from all
  AddType application/x-httpd-php .php
  php_flag magic_quotes_gpc off
  php_flag track_vars on
 </Directory>
expand-template /etc/httpd/conf/httpd.conf

php.ini

mkdir -p /etc/e-smith/templates-custom/etc/php.ini
nano /etc/e-smith/templates-custom/etc/php.ini/99Zarafa
 extension = mapi.so
expand-template /etc/php.ini

Restart httpd

signal-event ibay-modify

.qmail

enable zarafa for a user

db accounts setprop xxxx zarafa enabled 
mkdir -p /etc/e-smith/templates-user-custom/.qmail
nano -w /etc/e-smith/templates-user-custom/.qmail/80Zarafa

{
   my $zarafa = $user->prop('zarafa') || 'disabled';

   return "| /usr/bin/zarafa-dagent -q $USERNAME ; if [ $? -ne 0 ] ; then exit -1; else exit 99; fi;"
           if ($zarafa eq 'enabled');
}
/etc/e-smith/events/actions/qmail-update-user

Other tasks

Change webaccess apache rights

chown -R www:www /var/www/html/webaccess/tmp

Configure Zarafa services and add links for auto start

config set zarafa-server service status enabled
config set zarafa-spooler service status enabled
config set zarafa-gateway service status enabled [optional]
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-server
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-spooler
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99zarafa-gateway [optional, and yes it can start before -server]

Start Zarafa services

/etc/init.d/zarafa-server start
/etc/init.d/zarafa-spooler start
/etc/init.d/zarafa-gateway start [optional]

Create Zarafa public store

/usr/bin/zarafa-admin -s

Assigning an administrator

When a user is an administrator, the user will be allowed to open all Zarafa stores of any user.

List users:

/usr/bin/zarafa-admin -l

Update a user to admin status:

/usr/bin/zarafa-admin -u <username> -a 1

Usage

After implementing the .qmail fragment mail is sent to zarafa, and NOT the users ~\Maildir

Webmail

Access with browser for a local user

Windows Clients

  • MS Outlook using zarafaclient-*.msi add-on contained in the win32 directory of zarafa-*.tar.gz

IMAP

Configure your IMAP client to use port 144

Mobiles

UNTESTED

Install rpm, start service, configure

Issues

Backup

Nothing to do ?

data is in mysql, config files are in /etc, attachments possible in /home/e-smith/files/zarafa

Store_attachment_outside_of_the_database

http://zarafa.com/wiki/index.php/Store_attachment_outside_of_the_database

mkdir /home/e-smith/files/zarafa
nano /etc/zarafa/server.cfg
 attachment_storage      = files
 attachment_path         = /home/e-smith/files/zarafa

But but zarifa fails to start with log error

Mon 29 Sep 2008 12:28:29 AM EST: Connection to database 'zarafa' succeeded
Mon 29 Sep 2008 12:28:29 AM EST: zarafa-licensed not running, commercial features will not be available
Mon 29 Sep 2008 12:28:29 AM EST: Attachments are stored with option 'database', but 'files' is selected.
Mon 29 Sep 2008 12:28:29 AM EST: Server shutdown complete.


.qmail fragment

  • mailsorting contrib sorts to Maildir folders, zarafa won't see this mail. Disable procmail/maildrop and re-create internal zarafa rules

Restarting httpd-e-smith

Eg. modifying an ibay, causes a problem with webaccess

tail /var/log/messages
<snip>
Sep 28 16:30:27 kiwi httpd: PHP Warning:  Function registration failed - duplicate name - mapi_zarafa_getuser in Unknown on line 0
Sep 28 16:30:27 kiwi httpd: PHP Warning:  Function registration failed - duplicate name - mapi_zarafa_getgroup in Unknown on line 0
Sep 28 16:30:27 kiwi httpd: PHP Warning:  mapi:  Unable to register functions, unable to load in Unknown on line 0

workaround is to
sv restart httpd-e-smith

Address book

The Zarafa global address book finds users and groups from /etc/passwd etc/group

We don't want machine names, ibays, system, the group of a user, maybe others. I don't see how to hide them, changing shell to /bin/false may break things

Folder Naming

SME and Zarafa use different folder naming. To enhance migration SME folders should be renamed prior to migration.

drafts > Drafts
junkmail > Junk E-mail
sent-mail > Sent Items
trash > Deleted Items

Migrating users and data to Zarafa

Zarafa migration whitepaper describes various ways of migrating your users and your data to a Zarafa server.

http://download.zarafa.com/zarafa/release/docs/zarafa_migration.en.pdf

IMAP migration from SME/IMAP to Zarafa/IMAP

Configure zarafa-gateway for migration enabling IMAP on port 144 only as shown above

Get imapsync and required perl module

wget http://dag.wieers.com/rpm/packages/perl-Mail-IMAPClient/perl-Mail-IMAPClient-2.2.9-1.2.el4.rf.noarch.rpm
yum localinstall perl-Mail-IMAPClient-2.2.9-1.2.el4.rf.noarch.rpm
wget http://www.linux-france.org/prj/imapsync/dist/imapsync-1.264.tgz
tar -zxvf imapsync-1.264.tgz
cd ./imapsync-1.264
make install

Perform a user mail sync from SME/IMAP (host1/port1) to Zarafa/IMAP (host2/port2)

imapsync --noauthmd5 --host1 localhost --port1 143 --user1 <username> --password1 <password> --sep2 / --prefix2 "" --host2 localhost --port2 144 --user2 <username> --password2 <password>

Example to synchronize a user named 'bob' with password 'bob123' from SME IMAP into Zarafa:

imapsync --noauthmd5 --host1 localhost --port1 143 --user1 bob --password1 bob123 --sep2 / --prefix2 "" --host2 localhost --port2 144 --user2 bob --password2 bob123

After syncing is complete, stop zarafa-gateway service and/or edit /etc/zarafa/gateway.cfg to meet your needs.