August 2010


Installing Dovecot 2.x

Last week I’ve spend quite a lot of time playing with Dovecot 2.0.0 and 2.0.1 and I think I’ve finally nailed it. The whole configuration was turned upside down and I had to find out how everything worked again. Compiling stayed mostly the same, I only needed to change one option. But I’ve done it and I know have two test servers running 2.0.1 in a fully functioning setup as described earlier. Currently the documentation is only available for Snow Leopard but if anyone needs to run this on Leopard I’m willing to spend some time on it to find out how to do it.

Here is the new documentation:

If you want to upgrade from 1.2.x I would suggest just to compile and install 2.x, redo the configuration from scratch and restart Dovecot.

Dovecot updated to 1.2.14

A new version has been released of the 1.2.x branch, even now when Dovecot 2.x has been released there are still improvements to the 1.2.x branch. I’m working on the upgrade to 2.0 which is proving a challenge as the configuration is completely changed.

I’ve installed 1.2.14 on my production and a test machine still running 1.2.x and didn’t find any issues with it. The improvements are:

  • virtual mailboxes: Added support for IDLE notifications.
  • master: Don’t crash on config reload when using dict processes.
  • IMAP: QRESYNC parameters for SELECT weren’t handled correctly.

As I said, currently working on the upgrade to Dovecot 2.0, hope to have it done before the next weekend.

Security Update 2010-005

This is a Security Update which solves the problem with the malicious PDF’s that plagued the iPhone/iPad as well. Besides solving this issue there are some minor fixes. There are no changes to any of our software (yes even postfix is unaffected!) so you can run this without any problem. Read more about it in Apple’s Knowledge base article. All my test and production server are now safe and still working perfectly.

MySQL released 5.1.50

For everyone who is using to a 5.1.x version. This is a bug fix release and it is up to you if you want to upgrade. Check all the fixes and changes that are listed on the release notes to see what issues are resolved and if you are affected. Most of them are about replication which we don’t use in our setup.

If you are still using a 5.0.x version I would urge you to plan a upgrade to a 5.1.x version.

I’ve compiled this version and did some tests on my servers and it worked without any problems.

Read the documentation on how to ugrade MySQL.

Upgrading Roundcube to version 0.4

The Roundcube development team has released a new version of the webmail platform. New features include threaded message lists and address groups. Upgrading roundcube to version 0.4 isfairly straight forward.

Before continuing, make sure you have a current backup of your mysql database and your webserver. You need to download the latest code from the Roundcube site.

Extract the archive into the Document root of your Apache installation, in our case /Library/WebServer/Documents.

Step into the newly created directory and change the permissions on the temp and logs directory so that the webserver can write into these directories with the following commands:

cd /Library/WebServer/Documents/roundcubemail-0.4
sudo chown -R www:www temp
sudo chown -R www:www logs

Next we need to update the database structure for Roundcube-0.4. Start up MySQL on the command line as the roundcube user with this command:

mysql -u roundcube -p

Note: you will need to enter the password you chose for roundcube when you initially installed it. (if you have forgotten it can be found in the config/db.ini.php file of your old roundcubemail installation). If you have a different database name, use that instead of “roundcubemail”

If your upgrading from roundcubemail version 3.0-stable, run the following commands in the mysql shell:

USE roundcubemail
TRUNCATE `messages`;
ALTER TABLE `messages`
ADD INDEX `index_index` (`user_id`, `cache_key`, `idx`);
ALTER TABLE `session`
CHANGE `vars` `vars` MEDIUMTEXT NOT NULL;
ALTER TABLE `contacts`
ADD INDEX `user_contacts_index` (`user_id`,`email`);
quit

If your upgrading from roundcubemail version 3.1-dep, run the following commands in the mysql shell:

USE roundcubemail
ALTER TABLE `messages` DROP FOREIGN KEY `user_id_fk_messages`;
ALTER TABLE `cache` DROP FOREIGN KEY `user_id_fk_cache`;
ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`;
ALTER TABLE `identities` DROP FOREIGN KEY `user_id_fk_identities`;
ALTER TABLE `messages` ADD CONSTRAINT `user_id_fk_messages` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `cache` ADD CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `contacts` ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `identities` ADD CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `contacts` ALTER `name` SET DEFAULT ”;
ALTER TABLE `contacts` ALTER `firstname` SET DEFAULT ”;
ALTER TABLE `contacts` ALTER `surname` SET DEFAULT ”;
ALTER TABLE `identities` ADD INDEX `user_identities_index` (`user_id`, `del`);
ALTER TABLE `identities` ADD `changed` datetime NOT NULL DEFAULT ’1000-01-01 00:00:00′ AFTER `user_id`;
 
CREATE TABLE `contactgroups` (
  `contactgroup_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` int(10) UNSIGNED NOT NULL DEFAULT ’0′,
  `changed` datetime NOT NULL DEFAULT ’1000-01-01 00:00:00′,
  `del` tinyint(1) NOT NULL DEFAULT ’0′,
  `name` varchar(128) NOT NULL DEFAULT ”,
  PRIMARY KEY(`contactgroup_id`),
  CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`)
  REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  INDEX `contactgroups_user_index` (`user_id`,`del`)
);
 
CREATE TABLE `contactgroupmembers` (
  `contactgroup_id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL DEFAULT ’0′,
  `created` datetime NOT NULL DEFAULT ’1000-01-01 00:00:00′,
  PRIMARY KEY (`contactgroup_id`, `contact_id`),
  CONSTRAINT `contactgroup_id_fk_contactgroups` FOREIGN KEY (`contactgroup_id`)
  REFERENCES `contactgroups`(`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `contact_id_fk_contacts` FOREIGN KEY (`contact_id`)
  REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE
);
 
quit

The next step is a lot simpler. Point your browser to http://yourhostname/roundcubemail-0.4/installer/ and follow the instructions, just like you did when you initially installed roundcubemail.

In step 2 make sure you enter all the information as you did for the previous install of roundcubemail. Perhaps you had:

Database setup:
localhost
roundcubemail
roundcube
PASSWORD (or whatever you have it set too)
 
IMAP Settings:
ssl://localhost:993

If the installer was unable to create the config files you need to copy the contents located in the browser in the files db.inc.php and main.inc.php located in the directory config

If you have tested the setup and it works please remove the installer directory from the roundcube installation. It might be used by others to hack your installation.

For errors you could check the logfiles to explain what went wrong. For Roundcube errors check the /logs/errors file and for general mail errors check the /var/log/mail.log file.

Lastly, after you have checked that your new install is working properly, We need to change the symbolic link from our old installation to the new one. Then you can remove the previous version of roundcubemail from your webserver with:

sudo rm /Library/WebServer/Documents/roundcubemail
sudo ln -s /Library/WebServer/Documents/roundcubemail-0.4 /Library/WebServer/Documents/roundcubemail

Next Page »