[Dovecot] I need a quota expert

Jack Bates jbates at brightok.net
Wed Oct 10 17:43:02 EEST 2012


Looking at the wiki: http://wiki2.dovecot.org/Quota/Dict

It appears that the conf files for dict are different than the sql files 
for auth. This is why you are getting error messages. The auth config 
needs the driver option, the dict config does not. Create a file 
specifically for dict and point to that. Use the above wiki's examples 
for format.


Jack

On 10/10/2012 9:29 AM, Tibby wrote:
> I'm having problems with dovecot quota configuration.
> If I Include the driver mysql in dovecot-sql.conf I'm getting this error:
> dovecot: dict: Error in configuration file /etc/dovecot/dovecot-sql.conf line 1: Unknown setting: driver
> dovecot: dict: Failed to initialize dictionary 'quotadict'
>
> If I Don't include it:
> dovecot: auth(default): Fatal: sql: driver not set in configuration file /etc/dovecot/dovecot-sql.conf
> dovecot: auth(default): Fatal: sql: driver not set in configuration file /etc/dovecot/dovecot-sql.conf
>
> Now What???
> How Should I configure quota ?
>
> My SQL has a mail db with a user table.
> The table has email, password, quota_kb fields.
>
> my dovecot.conf:
> ----------------
> protocols = imap imaps pop3 pop3s
> log_timestamp = "%Y-%m-%d %H:%M:%S "
> mail_location = maildir:/home/vmail/%d/%n/Maildir
> disable_plaintext_auth = no
> ssl_cert_file = /etc/ssl/certs/dovecot.pem
> ssl_key_file = /etc/ssl/private/dovecot.pem
> namespace private {
>      separator = .
>      prefix = INBOX.
>      inbox = yes
> }
> protocol imap {
>    mail_plugins = quota imap_quota
> }
> protocol lda {
>      log_path = /home/vmail/dovecot-deliver.log
>      auth_socket_path = /var/run/dovecot/auth-master
>      postmaster_address = postmaster at domain.tld
>      mail_plugins = sieve quota
>      global_script_path = /home/vmail/globalsieverc
>      mail_plugin_dir = /usr/lib/dovecot/modules/lda
> }
> protocol pop3 {
>      pop3_uidl_format = %08Xu%08Xv
>      mail_plugins = quota
> }
> dict {
>    quotadict = mysql:/etc/dovecot/dovecot-sql.conf
> }
> plugin {
>    quota = dict:user::proxy::quotadict
>    quota_rule = *:storage=10M:messages=1000
> }
> auth default {
>      user = root
>      passdb sql {
>          args = /etc/dovecot/dovecot-sql.conf
>      }
>       userdb sql {
>           args = /etc/dovecot/dovecot-sql.conf
>       }
>      socket listen {
>          master {
>              path = /var/run/dovecot/auth-master
>              mode = 0600
>              user = vmail
>          }
>          client {
>              path = /var/spool/postfix/private/auth
>              mode = 0660
>              user = postfix
>              group = postfix
>          }
>      }
> }
> mail_uid = 5000
> mail_gid = 5000
>
>
>
>
>
> my dovecot-sql.conf:
> ----------------
> driver = mysql
> connect = host=127.0.0.1 dbname=mail user=****** password=******
> default_pass_scheme = CRYPT
> password_query = SELECT email as user, password, concat('*:storage=', quota_kb) AS quota_rule FROM users WHERE email='%u';
>
> user_query = SELECT CONCAT('/home/vmail/',CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1))) AS home, 5000 AS uid, 5000 AS gid, concat('*:storage=', quota_kb) AS quota_rule FROM users WHERE email='%u'
>
> map {
>    pattern = priv/quota/storage
>    table = user
>    username_field = user
>    value_field = quota_kb
> }
>
>
> SOMEBODY PLEASE HELP ME!!! :)




More information about the dovecot mailing list