[Dovecot] For Configuration Help: per-user quota for virtual users.
Dear dovecot list:
Could any experts help me on the configuration of per-user for dovecot on FreeBSD 7.x with postfix-2.5.4,1.
I followed the howto of http://workaround.org/articles/ispmail-etch/, it is an excellent file, my mailserver worked very well.
When I configured per-user quota plug-in, quota_rule with 20MB limits can not be overrided by the Mysql query statement, Although I followed the document at : http://wiki.dovecot.org/Quota.
Below is the output of dovecot --version, dovecot -n and dovecot-sql.conf. Could any experts help me?
Thanks in advance !
Best Regards, Forrest
ns1# dovecot --version
1.1.2
ns1# dovecot -n
# 1.1.2: /usr/local/etc/dovecot.conf
protocols: imap pop3 pop3s imaps
login_dir: /var/run/dovecot/login
login_executable(default): /usr/local/libexec/dovecot/imap-login
login_executable(imap): /usr/local/libexec/dovecot/imap-login
login_executable(pop3): /usr/local/libexec/dovecot/pop3-login
verbose_proctitle: yes
first_valid_gid: 0
mail_privileged_group: mail
mail_location: maildir:/home/vmail/%d/%n/Maildir
mail_executable(default): /usr/local/libexec/dovecot/imap
mail_executable(imap): /usr/local/libexec/dovecot/imap
mail_executable(pop3): /usr/local/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/local/lib/dovecot/imap
mail_plugin_dir(imap): /usr/local/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3
imap_client_workarounds(default): delay-newmail netscape-eoh
tb-extra-mailbox-sep
imap_client_workarounds(imap): delay-newmail netscape-eoh
tb-extra-mailbox-sep
imap_client_workarounds(pop3):
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
mechanisms: plain login
passdb:
driver: sql
args: /usr/local/etc/dovecot-sql.conf
userdb:
driver: passwd
userdb:
driver: static
args: uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes
socket:
type: listen
client:
path: /var/spool/postfix/private/auth
mode: 432
user: postfix
group: postfix
master:
path: /var/run/dovecot/auth-master
mode: 384
user: vmail
plugin:
quota: maildir
quota_rule: *:storage=20M
quota_rule2: Trash:storage=10M
quota_warning: storage=95%% /usr/local/bin/quota-warning.sh 95
quota_warning2: storage=80%% /usr/local/bin/quota-warning.sh 80
ns1# grep -v '^ *\(#.*\)\?$' dovecot-sql.conf
driver = mysql
connect = host=127.0.0.1 dbname=****** user=****** password=********
default_pass_scheme = PLAIN-MD5
password_query = SELECT email as user, password FROM view_users WHERE
email='%u';
user_query = select 5000 as uid, 5000 as gid, '/home/vmail/%d/%n' as home,
concat('*:bytes=', quota_bytes) as quota_rule
from email_quota where email = '%u'
On Sat, 2008-11-15 at 17:09 +0800, sales@100n.org wrote:
passdb: driver: sql args: /usr/local/etc/dovecot-sql.conf
You're using SQL as passdb.
userdb: driver: passwd userdb: driver: static args: uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes
But for userdb you're using /etc/passwd and static as a fallback. So this never gets called:
user_query = select 5000 as uid, 5000 as gid, '/home/vmail/%d/%n' as home,
concat('*:bytes=', quota_bytes) as quota_rule
from email_quota where email = '%u'
You should probably remove userdb passwd, userdb static and add userdb sql.
participants (2)
-
sales@100n.org
-
Timo Sirainen