1 (edited by insanadair 2012-01-24 00:43:51)

Topic: Error: Internal quota calculation error

==== Provide required information to help troubleshoot and get quick answer ====
- Linux/BSD distribution name and version:  DEBIAN LENNY updated 0.7.3
- iRedMail version and backend (LDAP/MySQL): MYSQL BACKEND
- Any related log? Log is helpful for troubleshooting.
====

I upgreded dovecot below link

http://www.iredmail.org/wiki/index.php? … 1.1.to.1.2

than

Store.Realtime.Quota.In.MySQL below link

http://www.iredmail.org/wiki/index.php? … a.In.MySQL

Can you help me please What is wrong ?

Have a error mail.log [ (temporary failure) ]
Have a error sieve.log  [ (Error: Internal quota calculation error) ]

Below tail -f /var/log/mail.log

Jan 23 15:41:19 mail postfix/pipe[8065]: 47A33E809A: to=<akarasahinx@example.com>, relay=dovecot, delay=517, delays=515/0.03/0/2.2, dsn=4.3.0, status=deferred (temporary failure)
Jan 23 15:41:19 mail postfix/pipe[8261]: 47A33E809A: to=<mtepegozx@example.com>, relay=dovecot, delay=517, delays=515/0.13/0/2.1, dsn=4.3.0, status=deferred (temporary failure)
Jan 23 15:41:19 mail postfix/pipe[8157]: 47A33E809A: to=<arahimix@example.com>, relay=dovecot, delay=517, delays=515/0.03/0/2.4, dsn=4.3.0, status=deferred (temporary failure)
Jan 23 15:41:19 mail postfix/pipe[8090]: 47A33E809A: to=<eozcakirx@example.com>, relay=dovecot, delay=517, delays=515/0.06/0/2.5, dsn=4.3.0, status=deferred (temporary failure)
Jan 23 15:41:19 mail postfix/pipe[8069]: 47A33E809A: to=<kgharehbaghix@example.com>, relay=dovecot, delay=518, delays=515/0.11/0/2.8, dsn=4.3.0, status=deferred (temporary failure)

below mailq

-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
1E325E8098     2585 Mon Jan 23 15:28:49  ozenbasx@yexample.com
                                                           (temporary failure)
                                         xodervisoglux@example.com

DC4E9E80A2    17921 Mon Jan 23 15:40:04  bounce-716_HTML-311633856-20973599-83255-36@bounce.reply.spie.org
                                                           (temporary failure)
                                         xmtepegozx@example.com

DF566E809C     2803 Mon Jan 23 15:32:46  ftankutx@example.com
                                                           (temporary failure)
                                         xecangax@example.com

Below tail -f /var/log/dovecot.log

Jan 23 15:47:41 POP3(eerdilx@example.com): Info: Namespace : Using permissions from //abc/xyz/vmail01//example.com/eerdil//Maildir: mode=0700 gid=-1
Jan 23 15:47:41 POP3(eerdilx@example.com): Info: Disconnected: Logged out top=0/0, retr=0/0, del=0/162, size=58329479
Jan 23 15:47:45 IMAP(aaydemirx@example.com): Info: Disconnected: Logged out bytes=451/1720
Jan 23 15:47:48 imap-login: Info: Login: user=<yadiguzelx@example.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Jan 23 15:47:48 IMAP(yadiguzelx@example.com): Info: Effective uid=1001, gid=1001, home=//abc/xyz/vmail01//example.com/yadiguzel/

Below tail -f /var/log/sieve.log


Jan 23 15:49:42 deliver(atoprakx@example.com): Info: dict quota: user=atoprakx@example.com, uri=proxy::quotadict, noenforcing=0
Jan 23 15:49:42 deliver(atoprakx@example.com): Info: sieve: user's script path /var/vmail/sieve/example.com/atoprakx/dovecot.sieve doesn't exist (using global script path in stead)
Jan 23 15:49:42 deliver(atoprakx@example.com): Info: sieve: using sieve path for user's script: /var/vmail/sieve/dovecot.sieve
Jan 23 15:49:42 deliver(atoprakx@example.com): Info: sieve: opening script /var/vmail/sieve/dovecot.sieve
Jan 23 15:49:42 deliver(atoprakx@example.com): Info: sieve: script file /var/vmail/sieve/dovecot.sieve is missing
Jan 23 15:49:42 deliver(atoprakx@example.com): Info: Namespace : Using permissions from //abc/xyz/vmail01//example.com/atoprakx//Maildir: mode=0700 gid=-1
Jan 23 15:49:42 deliver(atoprakx@example.comr): Error: Internal quota calculation error


Jan 23 15:54:42 deliver(yadiguzel@example.com): Info: maildir: data=//abc/xyz/vmail01//example.com/yadiguzel//Maildir/:INDEX=//abc/xyz/vmail01//example.com/xyadiguzelx//Maildir/
Jan 23 15:54:42 deliver(yadiguzel@example.com): Info: maildir++: root=//abc/xyz/vmail01//example.com/xyadiguzelx//Maildir, index=, control=, inbox=//abc/xyz/vmail01//example.com/xyadiguzelx//Maildir
Jan 23 15:54:42 deliver(yadiguzel@example.com): Info: dict quota: user=xyadiguzelx@example.com.tr, uri=proxy::quotadict, noenforcing=0
Jan 23 15:54:42 deliver(xyadiguzelx@example.com): Info: sieve: user's script path /var/vmail/sieve/example.com.tr/xyadiguzelxdovecot.sieve doesn't exist (using global script path in stead)
Jan 23 15:54:42 deliver(xyadiguzelx@example.com): Info: sieve: using sieve path for user's script: /var/vmail/sieve/dovecot.sieve
Jan 23 15:54:42 deliver(xyadiguzelx@example.com): Info: sieve: opening script /var/vmail/sieve/dovecot.sieve
Jan 23 15:54:42 deliver(xyadiguzelx@example.com): Info: sieve: script file /var/vmail/sieve/dovecot.sieve is missing
Jan 23 15:54:42 deliver(xyadiguzelx@example.com): Info: Namespace : Using permissions from //abc/xyz/vmail01//example.com/xyadiguzelx//Maildir: mode=0700 gid=-1
Jan 23 15:54:42 deliver(xyadiguzelx@example.com): Error: Internal quota calculation error
Jan 23 15:54:42 deliver(xyadiguzelx@example.com): Info: msgid=<a7c03732122c09d8ab3815b126d98d04@example.com>: save failed to INBOX: Internal error occurred. Refer to server log for more information. [2012-01-23 15:54:42]

Below vim /etc/dovecot/dovecot.conf
Note : I removed Quota setting on dovecot.conf but it doesnt work have error (temporary failure)  please help me

#
# File generated by iRedMail (2010.07.12.08.15.04):
#
# Version:  0.5.1
# Project:  http://www.iredmail.org/
#
# If you deploy iRedMail in product environment, we suggest
# you public your information in 'Success Stories' forum to help us
# promote iRedMail.
#
# Community: http://www.iredmail.org/community.html
#

# Provided services.
protocols =  pop3 pop3s imap imaps managesieve

# Listen addresses. for Dovecot-1.1.x.
# ipv4: *
# ipv6: [::]
#listen = *, [::]
listen = *

# mail uid/gid.
mail_uid = 1001
mail_gid = 1001

#
# Debug options.
#
mail_debug = yes
#auth_verbose = yes
#auth_debug = yes
#auth_debug_passwords = yes

#
# Log file.
#
#log_timestamp = "%Y-%m-%d %H:%M:%S "
log_path = /var/log/dovecot.log

#login_processes_count = 3
#login_max_processes_count = 128
#login_max_connections = 256
#max_mail_processes = 512

#umask = 0077
# Set max process size in megabytes. Default is 256.
# Most of the memory goes to mmap()ing files, so it shouldn't harm
# much even if this limit is set pretty high.
#
# Note:
# Some user reported that if mailbox is too large (e.g. 80GB), dovecot
# will disconnect the client with error:
# "pool_system_malloc(100248): Out of memory".
mail_process_size = 1024

disable_plaintext_auth = no

# Performance Tuning. Reference:
#   http://wiki.dovecot.org/LoginProcess
#
# High-Security mode. Dovecot default setting.
#
# It works by using a new imap-login or pop3-login process for each
# incoming connection. Since the processes run in a highly restricted
# chroot, running each connection in a separate process means that in
# case there is a security hole in Dovecot's pre-authentication code
# or in the SSL library, the attacker can't see other users'
# connections and can't really do anything destructive.
login_process_per_connection=yes

#
# High-Performance mode.
#
# It works by using a number of long running login processes,
# each handling a number of connections. This loses much of
# the security benefits of the login process design, because
# in case of a security hole the attacker is now able to see
# other users logging in and steal their passwords.
#login_process_per_connection = no

# Default realm/domain to use if none was specified.
# This is used for both SASL realms and appending '@domain.ltd' to username in plaintext logins.
auth_default_realm = example.com

# ---- NFS storage ----
# Set to 'no' For NFSv2. Default is 'yes'.
#dotlock_use_excl = yes 

#mail_nfs_storage = yes # v1.1+ only

# If indexes are on NFS.
#mail_nfs_index = yes # v1.1+ only
# ----

plugin {
    # Quota warning.
    #
    # You can find sample script from Dovecot wiki:
    # http://wiki.dovecot.org/Quota/1.1#head-03d8c4f6fb28e2e2f1cb63ec623810b45bec1734
    #
    # If user suddenly receives a huge mail and the quota jumps from
    # 85% to 95%, only the 95% script is executed.
    #
    quota_warning = storage=85%% /usr/bin/dovecot-quota-warning.sh 85
    quota_warning2 = storage=90%% /usr/bin/dovecot-quota-warning.sh 90
    quota_warning3 = storage=95%% /usr/bin/dovecot-quota-warning.sh 95
}

# SSL support.
# Refer to official documentation:
#   * http://wiki.dovecot.org/SSL/DovecotConfiguration
# Change comment by koray
#ssl_disable = yes
ssl = yes
verbose_ssl = no
ssl_key_file = /etc/ssl/private/iRedMail.key
ssl_cert_file = /etc/ssl/certs/iRedMail_CA.pem
# Maildir format and location.
# Such as: /var/mail/vmail01/iredmail.org/www/
#          ----------- ================
#          homeDirectory  mailMessageStore
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/

plugin {
#    quota = maildir
#Added By Koray
    quota = dict:user::proxy::quotadict
    # Quota rules. Reference: http://wiki.dovecot.org/Quota/1.1
    # The following limit names are supported:
    #   - storage: Quota limit in kilobytes, 0 means unlimited.
    #   - bytes: Quota limit in bytes, 0 means unlimited.
    #   - messages: Quota limit in number of messages, 0 means unlimited. This probably isn't very useful.
    #   - backend: Quota backend-specific limit configuration.
    #   - ignore: Don't include the specified mailbox in quota at all (v1.1.rc5+). 
    quota_rule = *:storage=100M
    #quota_rule2 = *:messages=0
    #quota_rule3 = Trash:storage=1G
    #quota_rule4 = Junk:ignore
}

dict {
    # NOTE: dict process currently runs as root, so this file will be owned as root.
    # Added By Koray
    #quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
    expire = db:/var/lib/dovecot/expire/expire.db
}

plugin {
    # ---- Expire plugin ----
    # Expire plugin. Mails are expunged from mailboxes after being there the
    # configurable time. The first expiration date for each mailbox is stored in
    # a dictionary so it can be quickly determined which mailboxes contain
    # expired mails. The actual expunging is done in a nightly cronjob, which
    # you must set up:
    #
    #   1   3   *   *   *   /usr/sbin/dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool
    #
    # Trash: 7 days
    # Trash's children directories: 7 days
    # Junk: 30 days
    expire = Trash 7 Trash/* 7 Junk 30
    expire_dict = proxy::expire

    # If you have a non-default path to auth-master, set also:
    auth_socket_path = /var/run/dovecot/auth-master
}

# Per-user sieve mail filter.
plugin {
    # For maildir format.
    # sieve = /home/vmail/sieve/%Ld/%Ln/dovecot.sieve
    # Change comment bellow line by Koray
    # sieve = /var/vmail/sieve/dovecot.sieve
    sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
    #Added Coment out 
    #sieve_dir = /var/vmail/sieve/%Ld/%Ln

}
# LDA: Local Deliver Agent
protocol lda { 
    postmaster_address = root
    auth_socket_path = /var/run/dovecot/auth-master
    #mail_plugins = cmusieve quota expire
    #mail_plugins = cmusieve quota
    #Change cmusieve to sieve by Koray
    mail_plugins = quota sieve autocreate
    sieve_global_path = /var/vmail/sieve/dovecot.sieve
    log_path = /var/log/sieve.log
}

# IMAP configuration
protocol imap {
    #mail_plugins = quota imap_quota zlib expire
    #Bellow Comment Changed By Koray
    mail_plugins = quota imap_quota autocreate

    imap_client_workarounds = tb-extra-mailbox-sep

    # number of connections per-user per-IP
    #mail_max_userip_connections = 10
}

# POP3 configuration
protocol pop3 {
    #mail_plugins = quota zlib expire
    #Bellow Comment Changed By Koray 
    mail_plugins = quota
    pop3_uidl_format = %08Xu%08Xv
    pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}

auth default {
    mechanisms = plain login
    user = vmail
    passdb sql {
        args = /etc/dovecot/dovecot-mysql.conf
    }
    userdb sql {
        args = /etc/dovecot/dovecot-mysql.conf
    }
    socket listen {
        master { 
            path = /var/run/dovecot/auth-master
            mode = 0666
            user = vmail
            group = vmail
        }
        client {
            path = /var/spool/postfix/dovecot-auth
            mode = 0666
            user = postfix
            group = postfix
        }
    }
}
protocol managesieve {
    # IP or host address where to listen in for connections.
    listen = 127.0.0.1:2000

    # Specifies the location of the symbolic link pointing to the
    # active script in the sieve storage directory.
    # Change bellow comment added by koray 
    # sieve = /home/vmail/sieve/%Ld/%Ln/dovecot.sieve

    # This specifies the path to the directory where the uploaded scripts are stored.
    # Change bellow comment added by koray
    # sieve_storage = /home/vmail/sieve/%Ld/%Ln/

    # Login executable location.
    login_executable = /usr/lib/dovecot/managesieve-login

    # managesieve executable location. See mail_executable for IMAP for
    # examples how this could be changed.
    mail_executable = /usr/lib/dovecot/managesieve

    # Maximum managesieve command line length in bytes.
    managesieve_max_line_length = 65536

    # To fool ManageSieve clients that are focused on CMU's timesieved
    # you can specify the IMPLEMENTATION capability that the dovecot
    # reports to clients (e.g. 'Cyrus timsieved v2.2.13').
    managesieve_implementation_string = dovecot
}

dovecot -n

# 1.2.15: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.26-2-686 i686 Debian 5.0.9 
log_path: /var/log/dovecot.log
protocols: pop3 pop3s imap imaps managesieve
listen(default): *
listen(imap): *
listen(pop3): *
listen(managesieve): 127.0.0.1:2000
ssl_cert_file: /etc/ssl/certs/iRedMail_CA.pem
ssl_key_file: /etc/ssl/private/iRedMail.key
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
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
mail_uid: 1001
mail_gid: 1001
mail_location: maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
mail_debug: yes
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_executable(managesieve): /usr/lib/dovecot/managesieve
mail_process_size: 1024
mail_plugins(default): quota imap_quota autocreate
mail_plugins(imap): quota imap_quota autocreate
mail_plugins(pop3): quota
mail_plugins(managesieve): 
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
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
imap_client_workarounds(default): tb-extra-mailbox-sep
imap_client_workarounds(imap): tb-extra-mailbox-sep
imap_client_workarounds(pop3): 
imap_client_workarounds(managesieve): 
pop3_client_workarounds(default): 
pop3_client_workarounds(imap): 
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
pop3_client_workarounds(managesieve): 
lda:
  postmaster_address: root
  auth_socket_path: /var/run/dovecot/auth-master
  mail_plugins: quota sieve autocreate
  sieve_global_path: /var/vmail/sieve/dovecot.sieve
  log_path: /var/log/sieve.log
auth default:
  mechanisms: plain login
  default_realm: mems.metu.edu.tr
  user: vmail
  passdb:
    driver: sql
    args: /etc/dovecot/dovecot-mysql.conf
  userdb:
    driver: sql
    args: /etc/dovecot/dovecot-mysql.conf
  socket:
    type: listen
    client:
      path: /var/spool/postfix/dovecot-auth
      mode: 438
      user: postfix
      group: postfix
    master:
      path: /var/run/dovecot/auth-master
      mode: 438
      user: vmail
      group: vmail
plugin:
  quota_warning: storage=85%% /usr/bin/dovecot-quota-warning.sh 85
  quota_warning2: storage=90%% /usr/bin/dovecot-quota-warning.sh 90
  quota_warning3: storage=95%% /usr/bin/dovecot-quota-warning.sh 95
  quota: dict:user::proxy::quotadict
  quota_rule: *:storage=100M
  expire: Trash 7 Trash/* 7 Junk 30
  expire_dict: proxy::expire
  auth_socket_path: /var/run/dovecot/auth-master
  sieve: /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
dict:
  expire: db:/var/lib/dovecot/expire/expire.db

netstat -nltp

tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      3607/dovecot    
tcp        0      0 127.0.0.1:7777          0.0.0.0:*               LISTEN      2970/python     
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      3607/dovecot    
tcp        0      0 127.0.0.1:10024         0.0.0.0:*               LISTEN      2360/amavisd (maste
tcp        0      0 127.0.0.1:10025         0.0.0.0:*               LISTEN      3715/master     
tcp        0      0 0.0.0.0:51017           0.0.0.0:*               LISTEN      1975/rpc.statd  
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      2420/mysqld     
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      3715/master     
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      3607/dovecot    
tcp        0      0 127.0.0.1:9998          0.0.0.0:*               LISTEN      2360/amavisd (maste
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      3607/dovecot    
tcp        0      0 127.0.0.1:10031         0.0.0.0:*               LISTEN      3063/postfix-policy
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1964/portmap    
tcp        0      0 127.0.0.1:2000          0.0.0.0:*               LISTEN      3607/dovecot    
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN      3715/master     
tcp        0      0 127.0.0.1:7634          0.0.0.0:*               LISTEN      2918/hddtemp    
tcp        0      0 127.0.0.1:756           0.0.0.0:*               LISTEN      3124/famd       
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2332/sshd       
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      3715/master     
tcp6       0      0 :::80                   :::*                    LISTEN      3278/apache2    
tcp6       0      0 :::22                   :::*                    LISTEN      2332/sshd       
tcp6       0      0 :::443                  :::*                    LISTEN      3278/apache2    

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Error: Internal quota calculation error

Hi insanadair,

You have quotadict commented out:

dict {
    # NOTE: dict process currently runs as root, so this file will be owned as root.
    # Added By Koray
    #quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
    expire = db:/var/lib/dovecot/expire/expire.db
}

Please enable it and restart Dovecot service first.