ftriboix at falcon-one.com
2009-Jun-23 08:15 UTC
[Dovecot] deliver does not update maildirsize
Hello,
I have installed postfix 2.5.1 + dovecot 1.0.13 + MySQL and it all works
perfectly. I use deliver as the local delivery agent and use IMAP only
with maildir mailboxes. I am using virtual mailboxes.
Now I wanted to introduce quotas, but I can't manage to make them work.
Quota information is retreived from MySQL in userdb requests.
I have noticed that the maildirsize file is not updated by deliver when
a new mail comes in. I don't know if this is correct or not...
It is updated though when I log in. But even then mails are still
received without any kind of problem while the mailbox is well over
the quota.
I tried to add a "-v" option to deliver in postfix's master.cf to
debug
deliver, but it apparently does not like this option.
Please find below my postfix and dovecot's configurations. Thank you very
much for any help.
NB: I removed some sensitive configuration option for this email
NB2: The user in question has a quota of 1MB
# postconf -n
alias_maps = mysql:/etc/postfix-2.5.1/mysql-localalias.cf
append_at_myorigin = no
append_dot_mydomain = no
biff = no
command_directory = /usr/local/postfix-2.5.1/sbin
config_directory = /etc/postfix-2.5.1
daemon_directory = /usr/local/postfix-2.5.1/libexec
data_directory = /var/postfix-2.5.1/data
debug_peer_level = 2
html_directory = /usr/local/postfix-2.5.1/doc/html
mail_owner = lpostfix
mail_spool_directory = /var/mail
mailq_path = /usr/local/postfix-2.5.1/bin/mailq
manpage_directory = /usr/local/postfix-2.5.1/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = MyHostingDomain
myhostname = MyMachine.MyHostingDomain
mynetworks_style = host
myorigin = $mydomain
newaliases_path = /usr/local/postfix-2.5.1/bin/newaliases
queue_directory = /var/postfix-2.5.1
readme_directory = /usr/local/postfix-2.5.1/doc/text
relay_domains relayhost = [MyRelayHost]
sample_directory = /etc/postfix-2.5.1
sendmail_path = /usr/sbin/sendmail
setgid_group = lpostdrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix-2.5.1/tmp-sasl-pwd
smtp_sasl_security_options = noanonymous
smtpd_recipient_restrictions permit_mynetworks, permit_sasl_authenticated,
reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient,
reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth.dovecot
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
syslog_facility = local0
unknown_local_recipient_reject_code = 550
virtual_alias_maps
mysql:/etc/postfix-2.5.1/mysql-alias.cf,mysql:/etc/postfix-2.5.1/mysql-global-alias.cf,mysql:/etc/postfix-2.5.1/mysql-email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_domains = mysql:/etc/postfix-2.5.1/mysql-domain.cf
virtual_mailbox_maps = mysql:/etc/postfix-2.5.1/mysql-mailbox.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000
# cat master.cf
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5
master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# =========================================================================#
service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# =========================================================================smtp
inet n - n - - smtpd
#submission inet n - n - - smtpd
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o smtp_fallback_relay# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail
argv=/usr/local/dovecot-1.0.13/libexec/dovecot/deliver -f ${sender} -d
${recipient}
# dovecot -n
# 1.0.13: /etc/dovecot-1.0.13/dovecot.conf
base_dir: /var/dovecot-1.0.13
log_path: /var/dovecot-1.0.13/log/errors.log
info_log_path: /var/dovecot-1.0.13/log/info.log
ssl_disable: yes
disable_plaintext_auth: no
login_dir: /var/dovecot-1.0.13/login
login_executable: /usr/local/dovecot-1.0.13/libexec/dovecot/imap-login
login_user: ldovecotlogin
mail_location: maildir:/var/vmail/%d/%n
mail_debug: yes
maildir_copy_with_hardlinks: yes
mail_plugins: quota imap_quota
auth default:
mechanisms: plain login
user: nobody
chroot: /var/dovecot-1.0.13
verbose: yes
debug: yes
debug_passwords: yes
passdb:
driver: sql
args: /etc/dovecot-1.0.13/dovecot-mysql-passdb.conf
userdb:
driver: sql
args: /etc/dovecot-1.0.13/dovecot-mysql-userdb.conf
socket:
type: listen
client:
path: /var/postfix-2.5.1/private/auth.dovecot
mode: 432
user: lpostfix
group: lpostfix
master:
path: /var/dovecot-1.0.13/auth-master
mode: 384
user: vmail
group: vmail
plugin:
quota: maildir:storage=10240:ignore=Trash
# cat dovecot-mysql-passdb.conf
driver = mysql
connect = [ --- snip --- ]
default_pass_scheme = PLAIN-MD5
password_query = SELECT password FROM view_vuser WHERE email = '%u' AND
active = 1
# cat dovecot-mysql-passdb.conf
driver = mysql
connect = [ --- snip --- ]
default_pass_scheme = PLAIN-MD5
user_query = SELECT 5000 AS uid, 5000 AS gid, CONCAT("maildir:", mail)
AS
mail, CONCAT(mail, "/home") AS home,
CONCAT("maildir:storage=", quota_mb *
1024, ":ignore=Trash") AS quota FROM view_vuser WHERE email =
'%u' AND
active = 1
# ls -l maildirsize
-rw------- 1 vmail vmail 20 2009-06-23 08:47 maildirsize
# cat maildirsize
1048576S
1846384 10
On 6/23/2009, ftriboix at falcon-one.com (ftriboix at falcon-one.com) wrote:> I have installed postfix 2.5.1 + dovecot 1.0.13 + MySQL and it all works > perfectly. I use deliver as the local delivery agent and use IMAP only > with maildir mailboxes. I am using virtual mailboxes. > > Now I wanted to introduce quotas, but I can't manage to make them work. > Quota information is retreived from MySQL in userdb requests.I think quota support is much improved in 1.1.x, so you might seriously consider upgrading before spending much time on it... -- Best regards, Charles
ftriboix at falcon-one.com
2009-Jun-24 16:14 UTC
[Dovecot] deliver does not update maildirsize
Hi Timo, Thank you very much for replying!> What does your configuration look like now? v1.1 has different quota > configuration. Is the problem only with deliver, or is imap also not > updating quota? And dovecot -n unfortunately doesn't show > protocol lda {} contents, so could you show them too? And finally, > enable mail_debug=yes and paste its logs when a message is delivered.mail_debug was already enabled, actually. maildirsize is not updated with imap now. If I logged in imap with dovecot 1.0.13, maildirsize was updated. This is not the case anymore with dovecot 1.1.16 ... I am actually realizing something. Do I need to add the "quota" plugin in the "protocol lda {}" section of dovecot.conf? Please find the configuration information below: # dovecot -n # 1.1.16: /etc/dovecot-1.1.16/dovecot.conf # OS: Linux 2.6.27.10-grsec-xxxx-grs-ipv4-32 i686 Debian 4.0 ext3 base_dir: /var/dovecot-1.1.16 log_path: /var/dovecot-1.1.16/log/errors.log info_log_path: /var/dovecot-1.1.16/log/info.log ssl_disable: yes disable_plaintext_auth: no login_dir: /var/dovecot-1.1.16/login login_executable: /usr/local/dovecot-1.1.16/libexec/dovecot/imap-login login_user: ldovecotlogin mail_location: maildir:/var/vmail/%d/%n mail_debug: yes mail_plugins: quota imap_quota auth default: mechanisms: plain login user: nobody chroot: /var/dovecot-1.1.16 verbose: yes debug: yes debug_passwords: yes passdb: driver: sql args: /etc/dovecot-1.1.16/dovecot-mysql-passdb.conf userdb: driver: sql args: /etc/dovecot-1.1.16/dovecot-mysql-userdb.conf socket: type: listen client: path: /var/postfix-2.5.1/private/auth.dovecot mode: 432 user: lpostfix group: lpostfix master: path: /var/dovecot-1.1.16/auth-master mode: 384 user: vmail group: vmail plugin: quota: maildir:Quota protocol lda { # Address to use when sending rejection mails. postmaster_address = postmaster at MyDomain # Hostname to use in various parts of sent mails, eg. in Message-Id. # Default is the system's real hostname. #hostname # Support for dynamically loadable plugins. mail_plugins is a space separated # list of plugins to load. #mail_plugins #mail_plugin_dir = /usr/lib/dovecot/lda # Binary to use for sending mails. #sendmail_path = /usr/lib/sendmail # UNIX socket path to master authentication server to find users. #auth_socket_path = /var/run/dovecot/auth-master log_path = /var/dovecot-1.1.16/log/delivery.log auth_socket_path = /var/dovecot-1.1.16/auth-master } # egrep '^deliver.test' info.log | tail deliver(test at MyDomain): Jun 24 13:28:35 Info: auth input: uid=5000 deliver(test at MyDomain): Jun 24 13:28:35 Info: auth input: gid=5000 deliver(test at MyDomain): Jun 24 13:28:35 Info: auth input: mail=maildir:/home/vmail/MyDomain/test deliver(test at MyDomain): Jun 24 13:28:35 Info: auth input: home=/home/vmail/MyDomain/test/home deliver(test at MyDomain): Jun 24 13:28:35 Info: auth input: quota=maildir:Quota deliver(test at MyDomain): Jun 24 13:28:35 Info: auth input: quota_rule=*:storage=1024 deliver(test at MyDomain): Jun 24 13:28:35 Info: auth input: quota_rule2=Trash:storage=50M deliver(test at MyDomain): Jun 24 13:28:35 Info: Home dir not found: /home/vmail/MyDomain/test/home deliver(test at MyDomain): Jun 24 13:28:35 Info: maildir: data=/home/vmail/MyDomain/test deliver(test at MyDomain): Jun 24 13:28:35 Info: maildir++: root=/home/vmail/MyDomain/test, index=, control=, inbox=/home/vmail/MyDomain/test deliver(test at MyDomain): Jun 24 13:28:35 Info: msgid=<290034.94281.qm at web24608.mail.ird.yahoo.com>: saved mail to INBOX deliver(test at MyDomain): Jun 24 16:59:57 Info: auth input: uid=5000 deliver(test at MyDomain): Jun 24 16:59:57 Info: auth input: gid=5000 deliver(test at MyDomain): Jun 24 16:59:57 Info: auth input: mail=maildir:/home/vmail/MyDomain/test deliver(test at MyDomain): Jun 24 16:59:57 Info: auth input: home=/home/vmail/MyDomain/test/home deliver(test at MyDomain): Jun 24 16:59:57 Info: auth input: quota=maildir:Quota deliver(test at MyDomain): Jun 24 16:59:57 Info: auth input: quota_rule=*:storage=1024 deliver(test at MyDomain): Jun 24 16:59:57 Info: auth input: quota_rule2=Trash:storage=50M deliver(test at MyDomain): Jun 24 16:59:57 Info: Home dir not found: /home/vmail/MyDomain/test/home deliver(test at MyDomain): Jun 24 16:59:57 Info: maildir: data=/home/vmail/MyDomain/test deliver(test at MyDomain): Jun 24 16:59:57 Info: maildir++: root=/home/vmail/MyDomain/test, index=, control=, inbox=/home/vmail/MyDomain/test deliver(test at MyDomain): Jun 24 16:59:57 Info: msgid=<542353.92671.qm at web24614.mail.ird.yahoo.com>: saved mail to INBOX # cat maildirsize 1048576S 1846384 10 Best regards, Fabrice