Greetings * We are having a problem with POP3 quota warnings, and despite we dig into the documentation, mailing list archives, google... we didn't spot any light We are running a self-compiled dovecot 1.1.7. The user base is in a Postgres database. We'd like a quota warning message to be injected into the maildir at 80% and 95% of occupation reached.>From the logs, it looks like dovecot is correctly reading the quotasfrom the DB. Nevertheless, the warning message is never delivered. We tried many different configurations (e.g.: from using bytes instead of storage to change the quota configuration alltogether, I think we tried every single sensible, applicable solution that we could spot during our searches in the net). Currently, we have the following non-working one: root at mgo2-popimap-v01:/usr/local/dovecot/etc# ../sbin/dovecot -n # 1.1.7: /usr/local/dovecot_1.1.7/etc/dovecot.conf Warning: fd limit 1024 is lower than what Dovecot can use under full load (more than 16384). Either grow the limit or change login_max_processes_count and max_mail_processes settings # OS: Linux 2.6.24.5-smp i686 Slackware 11.0.0 base_dir: /var/run/dovecot/ protocols: imap pop3 listen(default): mgo2-popimap-v01:143 listen(imap): mgo2-popimap-v01:143 listen(pop3): mgo2-popimap-v01:110 ssl_disable: yes disable_plaintext_auth: no shutdown_clients: no login_dir: /var/run/dovecot/login login_executable(default): /usr/local/dovecot/libexec/dovecot/imap-login login_executable(imap): /usr/local/dovecot/libexec/dovecot/imap-login login_executable(pop3): /usr/local/dovecot/libexec/dovecot/pop3-login login_greeting: POP/IMAP Server! login_max_processes_count: 4096 max_mail_processes: 8192 first_valid_uid: 4000 first_valid_gid: 4000 mail_location: maildir:%h/Maildir mail_debug: yes mmap_disable: yes mail_nfs_storage: yes mail_nfs_index: yes mail_executable(default): /usr/local/dovecot/libexec/dovecot/imap mail_executable(imap): /usr/local/dovecot/libexec/dovecot/imap mail_executable(pop3): /usr/local/dovecot/libexec/dovecot/pop3 mail_plugins(default): quota imap_quota mail_plugins(imap): quota imap_quota mail_plugins(pop3): quota mail_plugin_dir(default): /usr/local/dovecot/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/dovecot/lib/dovecot/imap mail_plugin_dir(pop3): /usr/local/dovecot/lib/dovecot/pop3 imap_client_workarounds(default): outlook-idle imap_client_workarounds(imap): outlook-idle imap_client_workarounds(pop3): pop3_uidl_format(default): %08Xu%08Xv pop3_uidl_format(imap): %08Xu%08Xv pop3_uidl_format(pop3): %v-%u pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh auth default: passdb: driver: sql args: /usr/local/dovecot/etc/dovecot-sql.conf userdb: driver: sql args: /usr/local/dovecot/etc/dovecot-sql.conf plugin: quota: maildir:User quota quota_rule: ?:storage=100M quota_warning: storage=95%% /usr/local/dovecot/bin/quota-warning.sh 95 %h %n %d quota_warning2: storage=80%% /usr/local/dovecot/bin/quota-warning.sh 80 %h %n %d root at mgo2-popimap-v01:/usr/local/dovecot/etc# grep -v '^ *\(#.*\)\?$' dovecot-sql.conf driver = pgsql connect = host=172.30.213.10 dbname=postfix user=postfix password=_HIDDEN_PASSWORD_ default_pass_scheme = SHA1 password_query = SELECT username, password FROM postfix.accounts WHERE (username = '%u' OR username = '%u at _HIDDEN_DOMAIN_') AND ( user_status_id = 0 or user_status_id = 2 ); user_query = SELECT maildir AS home, uid, gid, '*:storage=' || max_quota || 'B' AS quota_rule FROM postfix.accounts WHERE (username '%u' OR username = '%u at _HIDDEN_DOMAIN_') AND ( user_status_id = 2 OR user_status_id = 0 ) The log says: Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: POP3(rasrcbldg at _HIDDEN_DOMAIN_): Loading modules from directory: /usr/local/dovecot/lib/dovecot/pop3 Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: POP3(rasrcbldg at _HIDDEN_DOMAIN_): Module loaded: /usr/local/dovecot/lib/dovecot/pop3/lib10_quota_plugin.so Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: POP3(rasrcbldg at _HIDDEN_DOMAIN_): Effective uid=10812, gid=5008 Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: POP3(rasrcbldg at _HIDDEN_DOMAIN_): Quota root: name=User quota backend=maildir argsApr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: POP3(rasrcbldg at _HIDDEN_DOMAIN_): Quota rule: root=User quota mailbox=* bytes=104857600 (0%) messages=0 (0%) Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: POP3(rasrcbldg at _HIDDEN_DOMAIN_): Quota warning: bytes=99614720 (95%) messages=0 (0%) command=/usr/local/dovecot/bin/quota-warning.sh 95 /mnt/maildir/_HIDDEN_DOMAIN_/USER/r/ra/rasrcbldg at _HIDDEN_DOMAIN_ rasrcbldg _HIDDEN_DOMAIN_ Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: POP3(rasrcbldg at _HIDDEN_DOMAIN_): Quota warning: bytes=83886080 (80%) messages=0 (0%) command=/usr/local/dovecot/bin/quota-warning.sh 80 /mnt/maildir/_HIDDEN_DOMAIN_/USER/r/ra/rasrcbldg at _HIDDEN_DOMAIN_ rasrcbldg _HIDDEN_DOMAIN_ Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: POP3(rasrcbldg at _HIDDEN_DOMAIN_): maildir: data=/mnt/maildir/_HIDDEN_DOMAIN_/USER/r/ra/rasrcbldg at _HIDDEN_DOMAIN_/Maildir Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: POP3(rasrcbldg at _HIDDEN_DOMAIN_): maildir++: root=/mnt/maildir/_HIDDEN_DOMAIN_/USER/r/ra/rasrcbldg at _HIDDEN_DOMAIN_/Maildir, index=, control=, inbox=/mnt/maildir/_HIDDEN_DOMAIN_/USER/r/ra/rasrcbldg at _HIDDEN_DOMAIN_/Maildir Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: pop3-login: Login: user=<rasrcbldg at _HIDDEN_DOMAIN_>, method=PLAIN, rip=_HIDDEN_ADDRESS_, lip=192.168.207.16 Note that having this user's quota the same as the default quota is just an incident, if a user has a quota different from the default, the actual quota it is reported correctly in the logs. What are we doing wrong? Thanks for your help Kind Regards --Marco
Hello there I did some more research in the last two days, unfortunately without any result. First thing, I looked up all the relevant documentation and reviewed our configuration, in particular the directives regarding the quota configuration for POP3. Unless I overlooked something, it looked substantially correct to me. I also verified that the maildirsize file is updated the way I expected, and it is. I then focused on our quota-warning.sh script. I wanted to check if something was going wrong during the execution, so I added two logger commands in it. Now the script logs any execution attempt. Moreover, if it fails to inject a message into the mailbox, it logs the failure. After some debugging, I had it logging into /var/log/debug via syslog (see attachment). The script is in place since hours. Despite the fact that I deliberately triggered a warning condition on an account[*], nothing was logged, so it seems that the quota warning is never issued. And I can't make sense of it, because quota warnings seem to work regualrly via IMAP... Any clues? Pointers? Whatever? Are we missing something? Please don't let the Warnock Dilemma eat me! ;-) Ciao --bronto> root at mgo2-popimap-v01:/usr/local/dovecot/etc# ../sbin/dovecot -n > # 1.1.7: /usr/local/dovecot_1.1.7/etc/dovecot.conf > Warning: fd limit 1024 is lower than what Dovecot can use under full > load (more than 16384). Either grow the limit or change > login_max_processes_count and max_mail_processes settings > # OS: Linux 2.6.24.5-smp i686 Slackware 11.0.0 > base_dir: /var/run/dovecot/ > protocols: imap pop3 > listen(default): mgo2-popimap-v01:143 > listen(imap): mgo2-popimap-v01:143 > listen(pop3): mgo2-popimap-v01:110 > ssl_disable: yes > disable_plaintext_auth: no > shutdown_clients: no > login_dir: /var/run/dovecot/login > login_executable(default): /usr/local/dovecot/libexec/dovecot/imap-login > login_executable(imap): /usr/local/dovecot/libexec/dovecot/imap-login > login_executable(pop3): /usr/local/dovecot/libexec/dovecot/pop3-login > login_greeting: POP/IMAP Server! > login_max_processes_count: 4096 > max_mail_processes: 8192 > first_valid_uid: 4000 > first_valid_gid: 4000 > mail_location: maildir:%h/Maildir > mail_debug: yes > mmap_disable: yes > mail_nfs_storage: yes > mail_nfs_index: yes > mail_executable(default): /usr/local/dovecot/libexec/dovecot/imap > mail_executable(imap): /usr/local/dovecot/libexec/dovecot/imap > mail_executable(pop3): /usr/local/dovecot/libexec/dovecot/pop3 > mail_plugins(default): quota imap_quota > mail_plugins(imap): quota imap_quota > mail_plugins(pop3): quota > mail_plugin_dir(default): /usr/local/dovecot/lib/dovecot/imap > mail_plugin_dir(imap): /usr/local/dovecot/lib/dovecot/imap > mail_plugin_dir(pop3): /usr/local/dovecot/lib/dovecot/pop3 > imap_client_workarounds(default): outlook-idle > imap_client_workarounds(imap): outlook-idle > imap_client_workarounds(pop3): > pop3_uidl_format(default): %08Xu%08Xv > pop3_uidl_format(imap): %08Xu%08Xv > pop3_uidl_format(pop3): %v-%u > pop3_client_workarounds(default): > pop3_client_workarounds(imap): > pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh > auth default: > ?passdb: > ? ?driver: sql > ? ?args: /usr/local/dovecot/etc/dovecot-sql.conf > ?userdb: > ? ?driver: sql > ? ?args: /usr/local/dovecot/etc/dovecot-sql.conf > plugin: > ?quota: maildir:User quota > ?quota_rule: ?:storage=100M > ?quota_warning: storage=95%% /usr/local/dovecot/bin/quota-warning.sh > 95 %h %n %d > ?quota_warning2: storage=80%% /usr/local/dovecot/bin/quota-warning.sh > 80 %h %n %d > > root at mgo2-popimap-v01:/usr/local/dovecot/etc# grep -v '^ *\(#.*\)\?$' > dovecot-sql.conf > driver = pgsql > connect = host=172.30.213.10 dbname=postfix user=postfix > password=_HIDDEN_PASSWORD_ > default_pass_scheme = SHA1 > password_query = SELECT username, password FROM postfix.accounts WHERE > (username = '%u' OR username = '%u at _HIDDEN_DOMAIN_') AND ( > user_status_id = 0 or user_status_id = 2 ); > user_query = SELECT maildir AS home, uid, gid, '*:storage=' || > max_quota || 'B' AS quota_rule FROM postfix.accounts WHERE (username > '%u' OR username = '%u at _HIDDEN_DOMAIN_') AND ( user_status_id = 2 OR > user_status_id = 0 ) > > > The log says: > > Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: > POP3(rasrcbldg at _HIDDEN_DOMAIN_): Loading modules from directory: > /usr/local/dovecot/lib/dovecot/pop3 > Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: > POP3(rasrcbldg at _HIDDEN_DOMAIN_): Module loaded: > /usr/local/dovecot/lib/dovecot/pop3/lib10_quota_plugin.so > Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: > POP3(rasrcbldg at _HIDDEN_DOMAIN_): Effective uid=10812, gid=5008 > Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: > POP3(rasrcbldg at _HIDDEN_DOMAIN_): Quota root: name=User quota > backend=maildir args> Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: > POP3(rasrcbldg at _HIDDEN_DOMAIN_): Quota rule: root=User quota mailbox=* > bytes=104857600 (0%) messages=0 (0%) > Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: > POP3(rasrcbldg at _HIDDEN_DOMAIN_): Quota warning: bytes=99614720 (95%) > messages=0 (0%) command=/usr/local/dovecot/bin/quota-warning.sh 95 > /mnt/maildir/_HIDDEN_DOMAIN_/USER/r/ra/rasrcbldg at _HIDDEN_DOMAIN_ > rasrcbldg _HIDDEN_DOMAIN_ > Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: > POP3(rasrcbldg at _HIDDEN_DOMAIN_): Quota warning: bytes=83886080 (80%) > messages=0 (0%) command=/usr/local/dovecot/bin/quota-warning.sh 80 > /mnt/maildir/_HIDDEN_DOMAIN_/USER/r/ra/rasrcbldg at _HIDDEN_DOMAIN_ > rasrcbldg _HIDDEN_DOMAIN_ > Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: > POP3(rasrcbldg at _HIDDEN_DOMAIN_): maildir: > data=/mnt/maildir/_HIDDEN_DOMAIN_/USER/r/ra/rasrcbldg at _HIDDEN_DOMAIN_/Maildir > Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: > POP3(rasrcbldg at _HIDDEN_DOMAIN_): maildir++: > root=/mnt/maildir/_HIDDEN_DOMAIN_/USER/r/ra/rasrcbldg at _HIDDEN_DOMAIN_/Maildir, > index=, control=, > inbox=/mnt/maildir/_HIDDEN_DOMAIN_/USER/r/ra/rasrcbldg at _HIDDEN_DOMAIN_/Maildir > Apr 28 10:32:13 mgo2-popimap-v01._HIDDEN_DOMAIN_ dovecot: pop3-login: > Login: user=<rasrcbldg at _HIDDEN_DOMAIN_>, method=PLAIN, > rip=_HIDDEN_ADDRESS_, lip=192.168.207.16 > > Note that having this user's quota the same as the default quota is > just an incident, if a user has a quota different from the default, > the actual quota it is reported correctly in the logs.-------------- next part -------------- A non-text attachment was scrubbed... Name: quota-warning.sh Type: application/x-sh Size: 932 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20090430/3ae71a34/attachment-0002.sh>
Hello Rick, and thanks for replying First of all, the attached script had an error (I attached the wrong one :-\, the "export" line reads: export PATH="/usr/bin:/bin" 2009/4/30 <dovecot at dovecot.org>:> > It's a dumb question, but you are running the script via cron or manually > right? (dovecot doesn't execute it in it's own).>From the documentation, I'd expect it does. Inhttp://wiki.dovecot.org/Quota/1.1 I read:>>>You can configure Dovecot to run an external command when user's quota exceeds a specified limit.so I expect that it will run the script. Am I wrong? Ciao --bronto
> No, we don't. We use dovecot as POP/IMAP server, and let Postfix do the rest.How does Postfix deliver the mails? mailbox_command should be set to use deliver, not maildrop/procmail.> I see, but it seems like it is *another* solution rather than a > constraint.I just tested the quota-warning, with the dovecot-deliver-example. Exactly the same time as the mail exceeding the quota-percentage is delievered in the account, the quota-warning-message is generated and also delivered.> Anyway, we are neither sending an email nor using deliver. What we are > trying to do is to generate a message file that is injected into the > mailbox. But the script that should do that is never run by dovecot > :-(Try the injection using deliver, and use the "alternative script" from the wiki-page as quota_warning. I just tested it, works great. Also: when using dovecot-deliver, the maildir-indizes are being generated better and faster than with alternative MDAs. Best regards, Anton