[Dovecot] Override Quota with post-login scripting problem
Yorck Koehler
yorck.koehler at zag.de
Mon Nov 9 12:18:19 EET 2009
Hi everyone,
I do have the following dovecot-setup:
Passdb: PAM (Winbind-auth and pam_mkhomedir-session)
Userdb: passwd (NSS-winbind)
This validates/creates my users with aid of my running ActiveDirectory.
Now the problem: My global quota policy works fine, but I need to
override them for some users. I was sucessful within IMAP itself. I use
post-login scripting for that. The mail-clients displays the user-quota
correctly.
But delivery is still a problem, because I'm unable to override the
settings there with post-login scripting.
Everytime I send messages to such a user, dovecot sends it back with
"Quota exceeded (mailbox for user is full)"...
My Question: Is it possible to override the lda quota like I can do it
within imap ?
(I dont want to change my setup to MYSQL DB only for per-user Quota, if
its possible to use a simple file with names and quota)
This is the post-login script:
#quotaperuser.sh
#!/bin/sh
case "$USER" in
"ZAGH-V+username") QUOTA_RULE='*:storage=500M';;
"ZAGH-V+test") QUOTA_RULE='*:storage=5000M';;
esac
exec /usr/local/libexec/dovecot/imap $*
My Configuration:
{dovecot -n}
# 1.2.3: /usr/local/etc/dovecot.conf
# OS: Linux 2.6.16.60-0.54.5-smp i686 SUSE Linux Enterprise Server 10
(i586)
base_dir: /var/run/dovecot/
log_path: /var/log/dovecot.err
info_log_path: /var/log/dovecot.info
protocols: imap imaps pop3
ssl_listen: *
disable_plaintext_auth: no
login_dir: /var/run/dovecot//login
login_executable(default): /usr/local/libexec/dovecot/imap-login
login_executable(imap): /usr/local/libexec/dovecot/imap-login
login_executable(pop3): /usr/local/libexec/dovecot/pop3-login
mail_location: maildir:~/Maildir
mail_full_filesystem_access: yes
mail_executable(default): /usr/local/bin/quotaperuser.sh
mail_executable(imap): /usr/local/bin/quotaperuser.sh
mail_executable(pop3): /usr/local/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota expire
mail_plugins(imap): quota imap_quota expire
mail_plugins(pop3): quota expire
mail_plugin_dir(default): /usr/local/lib/dovecot/imap
mail_plugin_dir(imap): /usr/local/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3
pop3_uidl_format(default): %08Xu%08Xv
pop3_uidl_format(imap): %08Xu%08Xv
pop3_uidl_format(pop3): %v.%u
lda:
postmaster_address: postmaster at zag.de
mail_plugins: sieve quota expire
mail_plugin_dir: /usr/local/lib/dovecot/lda
quota_full_tempfail: no
deliver_log_format: msgid=%m subject=%s from=%f status=%$
auth default:
username_chars:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_ at +
username_format: zagh-v+%u
failure_delay: 0
passdb:
driver: pam
args: session=yes dovecot
userdb:
driver: passwd
plugin:
sieve: ~/.dovecot.sieve
sieve_dir: ~/sieve
quota: maildir:Quota
quota_rule: *:storage=100M
quota_rule2: Trash:storage=100M
quota_warning: storage=90%% /usr/local/bin/quota-warning.sh 90
quota_warning2: storage=75%% /usr/local/bin/quota-warning.sh 75
expire: trash 7
expire_dict: proxy::expire
More information about the dovecot
mailing list