I tried to set a quota setting. I installed dovecot with newest version, patched it and started it.
dovecot -n:

# 1.2.15: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.3 ext4
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imap imaps pop3 pop3s
ssl_listen: 143
ssl_cipher_list: ALL:!LOW:!SSLv2
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
mail_privileged_group: mail
mail_location: maildir:/var/vmail/%d/%n/Maildir
mbox_write_locks: fcntl dotlock
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
namespace:
  type: private
  inbox: yes
  list: yes
  subscriptions: yes
lda:
  postmaster_address: postmas...@opsys.de
  mail_plugins: sieve quota
  log_path:
auth default:
  mechanisms: plain login
  verbose: yes
  passdb:
    driver: sql
    args: /etc/dovecot/dovecot-sql.conf
  userdb:
    driver: static
args: uid=5000 gid=5000 home=/var/vmail/%d/%n/Maildir 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

/etc/dovecot/dovecot-sql.conf:


driver = mysql
connect = host=127.0.0.1 dbname=mailserver user=mailuser password=******
default_pass_scheme = PLAIN-MD5
password_query = SELECT email as user, password FROM virtual_users WHERE email='%u'; user_query = SELECT CONCAT('/var/mail/', maildir) AS home, CONCAT('*:bytes=', quota) AS quota_rule \
 FROM virtual_users WHERE email='%u'


virtual_users has this:

CREATE TABLE IF NOT EXISTS `virtual_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `domain_id` int(11) NOT NULL,
  `password` varchar(32) NOT NULL,
  `email` varchar(100) NOT NULL,
  `quota` int(11) NOT NULL DEFAULT '629145600',
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`),
  KEY `domain_id` (`domain_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

Also postfix is installed with this (not the hole cfg):

virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_limit_inbox = no
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql-quota.cf
virtual_mailbox_limit_override = yes
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_maildir_extended = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_maildir_limit_message_maps = mail:/etc/postfix/mysql-quota.cf
virtual_overquota_bounce = yes

/etc/postfix/mysql-quota.cf:

user = mailuser
password = ******
hosts = 127.0.0.1
dbname = mailserver
query = SELECT quota FROM virtual_users WHERE email='%s'


I changed the quota of my mail account to 40, so 40Byte should be the maximum. My account is at a size of 600KB now. I still recieve mails, also they will be saved without errors.

/var/log/mail.log says nothing to quota, just normal recieve and store entries.

What to fix?

--
Markus Fritz
Administration

opsys.de

Reply via email to