Alan Premselaar
2008-Jun-11 06:59 UTC
[Dovecot] quota-rewrite patch & userdb quota overriding
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've spent the past couple of hours trying to figure this out by checking the wiki and googling, but haven't come up with anything that works yet. I just installed dovecot 1.0.14 with the quota-rewrite (1.09) patch and i'm trying to get the quota overridden via a passwd-file type userdb. I had 1.0.13 without the new quota style patched in working but having trouble figuring this out. any help would be appreciated. prior to the quota-rewrite patch (which i installed with the hopes of using quota_warn feature) i was able to put the following line into my passwd-file userdb and it was working: alan:*:1000:1000::/home/alan::userdb_quota=maildir:storeage=2048000:ignore=Sent (which is what I wanted) but now with the new quota definition style, I'm not sure what I need to define the extra fields as. here is dovecot -n: # 1.0.14: /usr/local/etc/dovecot.conf log_path: /var/log/dovecot.log protocols: imap imaps managesieve ssl_cert_file: /etc/pki/tls/certs/dovecot.pem ssl_key_file: /etc/pki/tls/private/dovecot.pem disable_plaintext_auth: no login_dir: /usr/local/var/run/dovecot/login login_executable(default): /usr/local/libexec/dovecot/imap-login login_executable(imap): /usr/local/libexec/dovecot/imap-login login_executable(managesieve): /usr/local/libexec/dovecot/managesieve-login login_greeting_capability(default): yes login_greeting_capability(imap): yes login_greeting_capability(managesieve): no verbose_proctitle: yes mail_location: maildir:~/Maildir mail_debug: yes maildir_copy_with_hardlinks: yes mail_executable(default): /usr/local/libexec/dovecot/imap mail_executable(imap): /usr/local/libexec/dovecot/imap mail_executable(managesieve): /usr/local/libexec/dovecot/managesieve mail_plugins(default): quota imap_quota mail_plugins(imap): quota imap_quota mail_plugins(managesieve): mail_plugin_dir(default): /usr/local/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/lib/dovecot/imap mail_plugin_dir(managesieve): /usr/local/lib/dovecot/managesieve sieve_storage(default): sieve_storage(imap): sieve_storage(managesieve): ~/sieve sieve(default): sieve(imap): sieve(managesieve): ~/.dovecot.sieve auth default: ~ passdb: ~ driver: pam ~ userdb: ~ driver: passwd-file ~ args: /usr/local/etc/dovecot.passwd ~ userdb: ~ driver: passwd ~ socket: ~ type: listen ~ master: ~ path: /var/run/dovecot/auth-master ~ mode: 384 ~ user: dovecot ~ group: dovecot plugin: ~ quota_rule: *:storage=1G ~ quota_rule2: Trash:storage=100M thanks, alan -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhPd+cACgkQE2gsBSKjZHQNMACghSk7awVX1Aj5HVeo0KjRxyZc lT0AoLJA00SiYiefi2wNrAOt7L6N5eg4 =mA8L -----END PGP SIGNATURE-----
Timo Sirainen
2008-Jun-11 13:02 UTC
[Dovecot] quota-rewrite patch & userdb quota overriding
On Wed, 2008-06-11 at 15:59 +0900, Alan Premselaar wrote:> prior to the quota-rewrite patch (which i installed with the hopes of > using quota_warn feature) i was able to put the following line into my > passwd-file userdb and it was working: > > alan:*:1000:1000::/home/alan::userdb_quota=maildir:storeage=2048000:ignore=Sent > > (which is what I wanted) but now with the new quota definition style, > I'm not sure what I need to define the extra fields as.You'll most likely want to override quota_rule, so: ?alan:*:1000:1000::/home/alan::userdb_quota_rule=*:storage=2G The rest can be kept in: plugin { quota = maildir quota_rule = *:storage=1G quota_rule2 = Trash:storage=100M quota_rule3 = Sent:ignore # well, this works only with v1.1 actually } -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20080611/cf4781ff/attachment-0002.bin>
Alan Premselaar
2008-Jun-12 05:36 UTC
[Dovecot] quota-rewrite patch & userdb quota overriding
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 on 6/11/08 10:02 PM Timo Sirainen said the following: | On Wed, 2008-06-11 at 15:59 +0900, Alan Premselaar wrote: |> prior to the quota-rewrite patch (which i installed with the hopes of |> using quota_warn feature) i was able to put the following line into my |> passwd-file userdb and it was working: |> |> alan:*:1000:1000::/home/alan::userdb_quota=maildir:storeage=2048000:ignore=Sent |> |> (which is what I wanted) but now with the new quota definition style, |> I'm not sure what I need to define the extra fields as. | | You'll most likely want to override quota_rule, so: | | ?alan:*:1000:1000::/home/alan::userdb_quota_rule=*:storage=2G | | The rest can be kept in: | | plugin { | quota = maildir | quota_rule = *:storage=1G | quota_rule2 = Trash:storage=100M | quota_rule3 = Sent:ignore # well, this works only with v1.1 actually | } | Timo, Cheers, that sorted me out. Now I have a different problem I've been trying to workout with quota_warning. it appears that dovecot is reading the quota_warning settings properly and calculating the threshold properly[1] but for some reason it doesn't appear to be executing the command I've set. I'm trying to run a perl script. looking at the quota_warning code it doesn't appear that that would be a problem, and if it was it should return an error, which i'm not seeing in the logs so i'm not sure what's happening at this point. [1] here's some log data: deliver(testing): Jun 12 12:19:28 Info: Loading modules from directory: /usr/local/lib/dovecot/lda deliver(testing): Jun 12 12:19:28 Info: Module loaded: /usr/local/lib/dovecot/lda/lib10_quota_plugin.so deliver(testing): Jun 12 12:19:28 Info: Module loaded: /usr/local/lib/dovecot/lda/lib90_cmusieve_plugin.so deliver(testing): Jun 12 12:19:28 Info: auth input: testing deliver(testing): Jun 12 12:19:28 Info: auth input: uid=502 deliver(testing): Jun 12 12:19:28 Info: auth input: gid=502 deliver(testing): Jun 12 12:19:28 Info: auth input: home=/home/testing deliver(testing): Jun 12 12:19:28 Info: auth input: quota_rule=*:storage=2284K deliver(testing): Jun 12 12:19:28 Info: Quota root: namebackend=maildir argsdeliver(testing): Jun 12 12:19:28 Info: Quota rule: root= mailboxbytes=2338816 messages=0 deliver(testing): Jun 12 12:19:28 Info: Quota rule: root= mailbox=Trash bytes=104857600 messages=0 deliver(testing): Jun 12 12:19:28 Info: Quota warning: bytes=2104934 messages=0 command=/usr/local/bin/warnquota.pl 90 deliver(testing): Jun 12 12:19:28 Info: maildir: data=/home/testing/Maildir deliver(testing): Jun 12 12:19:28 Info: maildir: root=/home/testing/Maildir, index=/home/testing/Maildir, control=, inboxdeliver(testing): Jun 12 12:19:28 Info: msgid=<485095BA.30403 at rakuten-shashinkan.jp>: saved mail to INBOX if the account is actually over quota, deliver properly rejects the mail with Rejected: Quota exceeded. any ideas where to look? Also, it's not really clear what the command passed to quota_warn actually needs to do. in one post by the original creator of the quota_warning plugin (sorry, I don't recall their name) it looked like they just piped the output of an echo command to deliver - -c /path/to/alternate/dovecot/conf/without/quota_warning/settings . I've tried, that.. I've tried just having it write data to a file in /tmp .. neither of these techniques generate any results so I can only assume that it's not being executed. Thanks in advance. Alan -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhQtdMACgkQE2gsBSKjZHRanACfa48CraKzqeTwJsK6BL/+awaT BDMAn2QumM4R1bYksdbn+88Sw7eMPXW5 =W42g -----END PGP SIGNATURE-----