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