Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 20th May 2010, 01:34
radim_h radim_h is offline
Senior Member
Join Date: Jan 2007
Location: Prague, Czech
Posts: 426
Thanks: 34
Thanked 26 Times in 21 Posts
Send a message via ICQ to radim_h
Default HOWTO: Dovecot 1.2.9 + sieve + quota


i spent couple hours tampering with dovecot 1.2.9 on Ubuntu 10.04, now it finally works, so maybe someone can use it... it will be probalby same for Debian Squeeze

First, here is my /etc/dovecot/dovecot.conf file:

base_dir = /var/run/dovecot/

protocols = imap imaps pop3 pop3
disable_plaintext_auth = no
log_timestamp = "%Y-%m-%d %H:%M:%S "

ssl_cert_file = /etc/ssl/_.my-domain.tld/_.my-domain.tld.crt
ssl_key_file = /etc/ssl/_.my-domain.tld/_.my-domain.tld.key

mail_privileged_group = mail

login_greeting = my-domain.tld IMAP server ready...

## IMAP specific settings
protocol imap {
mail_executable = /usr/lib/dovecot/rawlog /usr/lib/dovecot/imap
  mail_plugins = quota imap_quota

## POP3 specific settings
protocol pop3 {
  mail_executable = /usr/lib/dovecot/rawlog /usr/lib/dovecot/pop3
  pop3_uidl_format = %08Xu%08Xv
  mail_plugins = quota

## LDA specific settings
protocol lda {
  # Address to use when sending rejection mails.
  postmaster_address = postmaster@my-domain.tld

  # Support for dynamically loadable plugins. mail_plugins is a space separated
  # list of plugins to load.
  mail_plugin_dir = /usr/lib/dovecot/modules/lda

  # UNIX socket path to master authentication server to find users.
  auth_socket_path = /var/run/dovecot/auth-master

  # Enabling Sieve plugin for server-side mail filtering
  mail_plugins = sieve quota

## Plugin settings
plugin {
        quota = maildir

## Authentication processes

# Executable location
#auth_executable = /usr/lib/dovecot/dovecot-auth
auth default {
  mechanisms = plain login
  passdb pam {

  # SQL database <doc/wiki/AuthDatabase.SQL.txt>
  passdb sql {
    # Path for SQL configuration file
    args = /etc/dovecot/dovecot-sql.conf

# new quota support:
        userdb prefetch {

        userdb sql {
                args = /etc/dovecot/dovecot-sql.conf

  ## dovecot-lda specific settings
  socket listen {
    master {
      path = /var/run/dovecot/auth-master
      mode = 0600
      user = vmail # User running Dovecot LDA
      #group = vmail # Or alternatively mode 0660 + LDA user in this group
  client {
          path = /var/spool/postfix/private/auth
          mode = 0660
          user = postfix
          group = postfix


mail_location = maildir:/var/vmail/%d/%n/Maildir

mail_uid = 5000
mail_gid = 5000
As you can have noticed all the users will have uid& gid 5000, also sieve script location & maildir will be following same pattern , so we don't have to read this data from MySQL all the time.

This is the original user query:
user_query = SELECT email as user, maildir as home, CONCAT(maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage', quota) AS quota, CONCAT(maildir, '/.sieve') AS sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n']

I have removed uid, gid, sieve and also "user_query = CONCAT(maildir, '/Maildir')" as is doen't seem to be used anywhere

Now we can modify
driver = mysql
connect = host=localhost dbname=dbispconfig user=ispconfig password=your_gerated_password_from_ISPC3
default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE email = '%u' AND disable%Ls = 'n'

### we must change user query, here is the correct one, notice that storage quota must be set in bytes
user_query = SELECT email AS user, maildir AS home, CONCAT('*:storage=', quota , 'B') AS quota_rule FROM mail_user WHERE email = '%u' AND disable%Ls = 'n'
That's it. Sieve scripts are working , roundcube is showing correct quota, also Thunderbird.

Last edited by radim_h; 20th May 2010 at 01:41.
Reply With Quote
The Following 4 Users Say Thank You to radim_h For This Useful Post:
bambam82 (19th August 2010), falko (20th May 2010), jameztcc (21st August 2010), till (20th May 2010)
Sponsored Links


dovecot, lenny, quota, squeeze, ubuntu 10.0.4

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig 3 + Dovecot + Squirrelmail + Sieve Chrisss Installation/Configuration 3 19th January 2011 04:29
Webmail problems with only one domain? compner Installation/Configuration 14 16th February 2010 17:59
Postfix can't received email from exterior astra2000 Server Operation 5 18th October 2009 00:26
Dovecot fails to deliver to all mail clients zwelabantu Server Operation 8 26th June 2009 13:17
Dovecot fails to deliver to all mail clients zwelabantu Installation/Configuration 3 19th June 2009 17:57

All times are GMT +2. The time now is 04:45.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.