[Dovecot] Per user quota on MySQL
Henrique Fernandes
sf.rique at gmail.com
Fri Dec 17 19:50:30 EET 2010
Try to use doveadm quota get to see if it is working!
#doveadm quota get -u example at domain.com
Quota name Type Value Limit %
user STORAGE 133189 1048576 12
user MESSAGE 2002 - 0
Use quota recalc also and see what happens.
Se quiser falar comigo em portugues diretamente para discutirmos outros
problems fique a vontade!
[]'sf.rique
On Fri, Dec 17, 2010 at 3:20 PM, M. Rodrigo Monteiro <
falecom at rodrigomonteiro.net> wrote:
> Hi!
>
> I'm new on Dovecot.
> I'm using:
> - CentOS 5.5
> - Kernel 2.6.18-194.26.1.el5 x86_64
> - Dovecot 2.0.8 (from source)
> - Postfix 2.7.2 (from source)
> - MySQL 5.0.77 (CentOS binary)
> - Postfixadmin 2.3.2 (from source)
> - Horde Webmail 1.2.9
> - Thunderbird 3.1.7 (from CentOS)
>
> I follow this how to:
> http://wiki2.dovecot.org/HowTo/DovecotLDAPostfixAdminMySQL
> I was able to send and recieve e-mail via Postfix/Dovecot.
>
> I'm having troubles in the quota.
> As I said, I use Postfixadmin to manage users.
> When I log in Horde, it says that the quota is unlimited. Thunderbird too.
>
> I think it's because of the configuration on Dovecot.
>
>
> Here it's my confs files:
>
>
> =====
> dovecot.conf
> =====
> #ssl_cert_file = /etc/pki/dovecot/certs/myserver.example.com.crt
> #ssl_key_file = /etc/pki/dovecot/private/myserver.example.com.key
> #ssl_ca_file = /etc/pki/dovecot/certs/ca-bundle.crt
> #default_login_user = nobody
> disable_plaintext_auth = no
> log_path = /var/log/dovecot.log
>
>
> auth_mechanisms = plain login
> first_valid_uid = 200
> last_valid_uid = 200
> mail_location = maildir:/var/vmail/%d/%u
> ssl = no
>
> passdb {
> args = /usr/local/dovecot/etc/dovecot/sql.conf
> driver = sql
> }
> plugin {
> #acl = vfile:/usr/local/dovecot/etc/dovecot/acls
> quota = maildir:storage=10240:messages=1000
> trash = /usr/local/dovecot/etc/dovecot/trash.conf
> }
> service auth {
> unix_listener auth-userdb {
> group = vmail
> mode = 0660
> user = vmail
> }
> unix_listener auth-master {
> group = vmail
> mode = 0660
> user = vmail
> }
> unix_listener /var/spool/postfix/private/auth {
> group = vmail
> mode = 0660
> user = postfix
> }
> user = dovecot
> }
> userdb {
> args = /usr/local/dovecot/etc/dovecot/sql.conf
> driver = sql
> }
> userdb {
> driver = prefetch
> }
> protocol imap {
> imap_client_workarounds = delay-newmail
> mail_plugins = quota imap_quota
> }
> protocol pop3 {
> mail_plugins = quota
> pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
> }
> protocol lda {
> mail_plugins = quota
> postmaster_address = postmaster at mydomain.com
> #log_path = /var/log/dovecot.log
> #info_log_path = /var/log/dovecot.log
> }
> =====
>
>
> =====
> sql.conf
> =====
> driver = mysql
> connect = host=localhost dbname=postfix user=dovecot password=password
> user_query = SELECT concat('/var/vmail/', maildir) as home,
> concat('maildir:/var/vmail/', maildir) as mail, 200 AS uid, 200 AS
> gid, concat('maildir:storage=', floor(quota/1024)) AS quota FROM
> mailbox WHERE username = '%u' AND active = '1'
> =====
>
>
> =====
> mysql
> =====
> mysql> select * from mailbox;
>
> +----------------------+------------------------------------+--------------+-----------------------+---------+------------+----------------+---------------------+---------------------+--------+
> | username | password | name
> | maildir | quota | local_part | domain |
> created | modified | active |
>
> +----------------------+------------------------------------+--------------+-----------------------+---------+------------+----------------+---------------------+---------------------+--------+
> | teste at mydomain.com | $1$bb3d6a71$IF/FORTbdoIqdzBLuSciJ0 | E-mail
> Teste | mydomain.com/teste/ | 1024000 | teste | mydomain.com |
> 2010-12-17 10:32:16 | 2010-12-17 11:46:24 | 1 |
>
> +----------------------+------------------------------------+--------------+-----------------------+---------+------------+----------------+---------------------+---------------------+--------+
> =====
>
>
> =====
> mysql_virtual_mailbox_limit_maps.cf
> =====
> user = postfix
> password = password
> hosts = localhost
> dbname = postfix
> query = SELECT quota FROM mailbox WHERE username='%s' AND active
> = '1'
> =====
>
>
> I think it's it. If I forgot something, please let me know.
>
>
> Regards,
> Rodrigo.
>
> --
>
> M. Rodrigo Monteiro
>
> "Free as in Freedom, not free as in free beer"
> "As we are liberated from our own fear, our presence automatically
> liberates others"
> Linux User # 403730
>
> Pense antes de imprimir. Think before printing.
>
> AVISO LEGAL
> Esta mensagem é destinada exclusivamente para a(s) pessoa(s) a quem é
> dirigida, podendo conter informação confidencial e/ou legalmente
> privilegiada. Se você não for destinatário desta mensagem, desde já
> fica notificado de abster-se a divulgar, copiar, distribuir, examinar
> ou, de qualquer forma, utilizar a informação contida nesta mensagem,
> por ser ilegal. Caso você tenha recebido esta mensagem por engano,
> pedimos que nos retorne este E-Mail, promovendo, desde logo, a
> eliminação do seu conteúdo em sua base de dados, registros ou sistema
> de controle. Fica desprovida de eficácia e validade a mensagem que
> contiver vínculos obrigacionais, expedida por quem não detenha poderes
> de representação.
>
> LEGAL ADVICE
> This message is exclusively destined for the people to whom it is
> directed, and it can bear private and/or legally exceptional
> information. If you are not addressee of this message, since now you
> are advised to not release, copy, distribute, check or, otherwise, use
> the information contained in this message, because it is illegal. If
> you received this message by mistake, we ask you to return this email,
> making possible, as soon as possible, the elimination of its contents
> of your database, registrations or controls system. The message that
> bears any mandatory links, issued by someone who has no representation
> powers, shall be null or void.
>
More information about the dovecot
mailing list