[BUG-FIX] Mail quota not working LMTP & LDA (sieve)
Posted: Fri Feb 20, 2015 9:07 pm
edit: Please see post below for solution to get quota working with LDA and/or LMTP transports and for a working LDA configuration (imho the config still needs some polishing). I thought to post my 'semi-finished' config files here, as I have experienced that the documentation of Exim and Dovecot is quite hard to get through.
Hello,
After configuring dovecot to use lmtp with exim and enabling antispam module, quota was still working with current accounts. If I create a new mailbox, then the quota amount is also visible in the passwd files (/etc/exim4...). However, if I run doveadm quota get -u <e-mail address> then there is no limit set on STORAGE (the value is present in the passwd files, though) as you can see below. If I adjust the quota of an already existed account or new account (doesn't matter), then quota doesn't get set or stays at the old value.
Could it be the issue that the v-add-mail-account script uses doveadm to create a new account? Should it perhaps use lmtp to create a new account (although this doesn't make any sense to me).
Output of passwd file of the domain results in the following data:
As you can see, quota gets set, but gets lost somehow / somewhere.
Can anybody help me to solve this annoying issue? IMAP and all works beautifully, but only quota doesn't get through anymore. Quota is visible in the control panel, though.
My dovecot config:
Hello,
After configuring dovecot to use lmtp with exim and enabling antispam module, quota was still working with current accounts. If I create a new mailbox, then the quota amount is also visible in the passwd files (/etc/exim4...). However, if I run doveadm quota get -u <e-mail address> then there is no limit set on STORAGE (the value is present in the passwd files, though) as you can see below. If I adjust the quota of an already existed account or new account (doesn't matter), then quota doesn't get set or stays at the old value.
Could it be the issue that the v-add-mail-account script uses doveadm to create a new account? Should it perhaps use lmtp to create a new account (although this doesn't make any sense to me).
Code: Select all
$ doveadm quota get -u <e-mail address>
Quota name Type Value Limit %
STORAGE 21926 - 0
MESSAGE 2 - 0
Code: Select all
$ cat /etc/exim4/domains/<user-domain>/passwd
test1:<pass-hash>:<username>:mail::/home/<username>:100
test2:<pass-hash>:<username>:mail::/home/<username>:50
Can anybody help me to solve this annoying issue? IMAP and all works beautifully, but only quota doesn't get through anymore. Quota is visible in the control panel, though.
My dovecot config:
Code: Select all
$ doveconf -n
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-042stab092.2 i686 Debian 7.8
auth_mechanisms = login plain
auth_verbose = yes
base_dir = /var/run/dovecot/
log_path = /var/log/dovecot/dovecot.log
mail_access_groups = mail
mail_location = maildir:%h/mail/%d/%n
mail_plugins = " quota"
mail_privileged_group = mail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
namespace inbox {
inbox = yes
location =
mailbox Archive {
auto = subscribe
special_use = \Archive
}
mailbox Archives {
auto = no
special_use = \Archive
}
mailbox "Deleted Messages" {
auto = no
special_use = \Trash
}
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Junk {
auto = subscribe
special_use = \Junk
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
mailbox "Sent Messages" {
auto = no
special_use = \Sent
}
mailbox Trash {
auto = subscribe
special_use = \Trash
}
prefix =
}
passdb {
args = scheme=MD5-CRYPT username_format=%n /etc/exim4/domains/%d/passwd
driver = passwd-file
}
plugin {
antispam_backend = pipe
antispam_pipe_program = /usr/bin/sa-learn
antispam_pipe_program_notspam_arg = --ham
antispam_pipe_program_spam_arg = --spam
antispam_spam = Junk
antispam_trash = Trash
quota = maildir
quota_rule = Trash:ignore
quota_rule2 = Spam:ignore
sieve = ~/.sieve/%d/%n/.dovecot.sieve
sieve_before = /var/lib/dovecot/sieve/default.sieve
sieve_default = /var/lib/dovecot/sieve/default.sieve
sieve_dir = ~/.sieve/%d/%n/scripts
sieve_global_dir = /var/lib/dovecot/sieve/
sieve_max_script_size = 1M
}
protocols = lmtp sieve imap pop3
service auth {
unix_listener auth-client {
group = mail
mode = 0660
user = dovecot
}
user = dovecot
}
service lmtp {
executable = lmtp -L
}
service managesieve-login {
inet_listener sieve {
port = 4190
}
process_min_avail = 1
service_count = 1
vsz_limit = 64 M
}
service managesieve {
process_limit = 512
}
ssl = required
ssl_cert = </usr/local/vesta/ssl/certificate.crt
ssl_key = </usr/local/vesta/ssl/certificate.key
ssl_protocols = !SSLv2 !SSLv3
userdb {
args = username_format=%n /etc/exim4/domains/%d/passwd
driver = passwd-file
}
protocol imap {
imap_idle_notify_interval = 2 mins
mail_plugins = " quota imap_quota antispam"
}
protocol lmtp {
info_log_path = /var/log/dovecot/dovecot-lmtp.log
log_path = /var/log/dovecot/dovecot-lmtp-errors.log
mail_plugins = " quota sieve"
}