Upgrade/iRedMail/0.7.4-rc3-0.7.4

From iRedMail
Revision as of 11:55, 8 January 2012 by ZhangHuangbin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents


This upgrade tutorial is applicable to iRedMail-0.7.4-rc3, used to upgrade to 0.7.4 stable release.

General

[Debian and Ubuntu special] Assign Apache daemon user to group "adm"

Note: This fix is applicable to only Debian and Ubuntu.

Assign Apache daemon user to group "adm" to avoid Awstats cron job issue.

Terminal:
# usermod -g adm www-data

OpenLDAP backend special

No changes.

MySQL backend special

Store realtime mailbox quota usage in seperate SQL table

Summary:

In iRedMail-0.7.3 and some earlier versions, Dovecot stores realtime mailbox quota usage in MySQL database in two columns: mailbox.bytes, mailbox.messages, if they have invalid values (e.g. empty value, non-integer value), Dovecot will update them with two SQL commands:

  1. First one: delete record. (DELETE FROM mailbox WHERE username='xxx@yyy.com')
  2. Second: create a new record with current, correct quota info. (INSERT INTO mailbox (username, bytes, messages) VALUES ('xxx@yyy.com', xx, xx))

First one will delete iRedMail mail user, that's the problem. User OviVan reports this issue after migrated user mailboxes to iRedMail-0.7.3.

So we have to store realtime mailbox quota usage in a separate MySQL table to avoid similar issues.

Below are steps to store realtime mailbox quota usage in a separate SQL table:

  • Create new SQL table vmail.used_quota to store mailbox quota:
Terminal:
# mysql -uroot -p
mysql> USE vmail;
mysql> CREATE TABLE IF NOT EXISTS `used_quota` (
    `username` VARCHAR(255) NOT NULL,
    `bytes` BIGINT NOT NULL DEFAULT 0,
    `messages` BIGINT NOT NULL DEFAULT 0,
    PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  • Replace table = mailbox with table = used_quota in below config file, so that Dovecot will store mailbox quota in new SQL table.
    • On RHEL/CentOS/Scientific Linux 5.x, please update /etc/dovecot-used-quota.conf, on 6.x, please update /etc/dovecot/used-quota.conf.
    • On Debian/Ubuntu, please update /etc/dovecot/dovecot-used-quota.conf.
    • On openSUSE, please update /etc/dovecot/dovecot-used-quota.conf.
    • On FreeBSD, please update /usr/local/etc/dovecot-used-quota.conf.
  • Restarting Dovecot service is required.
Personal tools