Quota problem with Dovecot 2.0

Patric F.
2011-03-24
2013-01-23
  • Patric F.
    Patric F.
    2011-03-24

    Hi,

    I've been trying forever to get this to work but I just can't. I have quouta running just fine on a system with Dovecot 1.0 or 1.1 but with 2.0 I just get errors all the time.

    It feels like I have tried everything and I'm getting a little bit confused as it says different stuff on different places. For example on the Dovecot Wiki it says something else from what it says in the Postfixadmin documentation, but I've tried both and get pretty much the same result.

    I get this error:

    Error: Dictionary URI is missing ':': quota
    Error: user mail@domain.com: Initialization failed: Failed to initialize quota: Quota root storage=1048576 proxy: init() failed
    Error: Invalid user settings. Refer to server log for more information.
    

    dovecot-sql.conf:

    driver = mysql
    connect = host=localhost dbname=postfix user=postfix password=password
    default_pass_scheme = MD5
    password_query = SELECT password FROM mailbox WHERE username = '%u'
    user_query = SELECT maildir, 125 AS uid, 125 AS gid, CONCAT('dict:storage=',floor(quota/1000),' proxy::quota') as quota FROM mailbox WHERE username = '%u' AND active='1'
    

    dovecot-dict-quota.conf:

    driver = mysql
    connect = host=localhost dbname=postfix user=postfix password=password
    default_pass_scheme = MD5-CRYPT
    table = quota2
    select_field = current
    where_field = path
    username_field = username
    

    dovecot.conf:

    auth_mechanisms = plain login
    dict {
      quota = mysql:/usr/local/etc/dovecot/dovecot-dict-quota.conf
    }
    disable_plaintext_auth = no
    dotlock_use_excl = yes
    first_valid_gid = 125
    first_valid_uid = 125
    last_valid_gid = 125
    last_valid_uid = 125
    login_greeting = Mail Server Ready.
    mail_location = maildir:/usr/local/virtual/%d/%n
    mail_privileged_group = mail
    passdb {
      args = /usr/local/etc/dovecot/dovecot-sql.conf
      driver = sql
    }
    protocols = imap pop3
    service auth {
      unix_listener /var/spool/postfix/private/auth {
        group = postfix
        mode = 0660
        user = postfix
      }
      user = root
    }
    ssl_cert = </etc/ssl/dovecot/cert.pem
    ssl_key = </etc/ssl/dovecot/key.pem
    userdb {
      args = /usr/local/etc/dovecot/dovecot-sql.conf
      driver = sql
    }
    verbose_proctitle = yes
    protocol imap {
      imap_client_workarounds = delay-newmail  tb-extra-mailbox-sep
      mail_plugins = quota imap_quota
    }
    protocol pop3 {
      mail_plugins = quota
      pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
      pop3_uidl_format = %08Xu%08Xv
    }
    protocol lda {
      mail_plugins = quota
      postmaster_address = postmaster@omg.nu
      sendmail_path = /usr/sbin/sendmail
    }
    plugin {
    quota = dict:user::proxy::quotadict
    }
    

    Have I read the documentation wrong? Did I make a typo somewhere? I've been going at this for a really long time now and can't find anything else I can try.

    Thankful for any response!

    Thanks,
    -Patric

     
  • Kilrathy
    Kilrathy
    2011-04-29

    Try this:

    dict { quotadict = mysql:/usr/local/etc/dovecot/dovecot-dict-quota.conf }
    plugin { quota = dict:user::proxy::quotadict }/code]