- Backup your /etc/dovecot/*.conf files
- Analyze what quota limit would be suitable for you (du -hs /home/vmail/example.org/*)
- Open /etc/dovecot/dovecot.conf and add the plugins "quota" and "imap_quota" and define location of the plugin directory
- Jump to the LDA section and add the "quota" plugin:
- Search for "userdb static". This section was defined in the workaround.org howto. Because we want to store quota settings in MySQL, we must add a section which takes precedence over that static section. So add the following section before userdb static:
- Now jump to the "plugin" section at the end of the file. We define the default quota size in KB here.
- As the user database stores things like mail/home directory, group and user IDs too, we have to return them somehow with the SQL query. Next we have to edit the /etc/dovecot/dovecot-sql.conf in order to fetch these fields. Add the following SQL query:
So this query basically replaces the "userdb static" section. We select a static user- and group-id, mail home-directory and the quota limit in KB from the field quota_kb which you will have to add to the table virtual_users (type int 11).Possible field values:
- A NULL-value in the field quota_kb results in the default quota value being used (defined in /etc/dovecot/dovecot.conf)
- A value of "0" (zero) disables quota for that user
- Any other valid number in KB sets quota