[Dovecot] expire plugin + --exec-mail in 1.2.6 version

Nikita Koshikov koshikov at gmail.com
Fri Oct 30 11:00:36 EET 2009


On Thu, 29 Oct 2009 13:10:37 -0400
Timo Sirainen <tss at iki.fi> wrote:

> On Wed, 2009-10-28 at 10:30 +0200, Nikita Koshikov wrote:
> > The  problem that some users have their own quotas stored in ldap. 
> 
> So the quota_rule should be returned by userdb lookup from ldap, right?

Yes, and it's working fine with deliver and general imap process, it only failed(reset to general quota_rule) after expire-rool.sh script finished his duties.

> 
> > Info: auth input: uid=8
> > Info: auth input: gid=12
> > Info: auth input: home=/data/mail/domain.com/koshikov.n
> > Info: auth input: mail=maildir:~/data
> 
> This should have listed quota_rule.
> 
The problematic user is sr, and it has quota_rule option(running with --test)

(Thu Oct 29 07:45:18 2009)
Info: auth input: quota_rule=*:bytes=10485760000
			^^^^^^^^^^^^^^^^^^^^^^^^^ returned from ldap		
Info: auth input: uid=8
Info: auth input: gid=12
Info: auth input: home=/data/mail/domain.com/sr
Info: auth input: mail=maildir:~/data
Info: Namespace: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes
Info: maildir: data=~/data
Info: maildir++: root=/data/mail/domain.com/sr/data, index=, control=, inbox=/data/mail/domain.com/sr/data
Info: Namespace: type=private, prefix=Agromat/, sep=/, inbox=no, hidden=no, list=yes, subscriptions=no
Info: virtual: data=/var/mail/virtual:INDEX=MEMORY:LAYOUT=maildir++
Info: maildir++: root=/var/mail/virtual, index=, control=, inbox=
Info: Namespace : Using permissions from /data/mail/domain.com/sr/data: mode=0700 gid=-1
Info: trash plugin: Added 'Trash' with priority 1
Info: trash plugin: Added 'Spam' with priority 2
Info: sr at domain.com/Spam: seq=1 uid=405: Expunge
Info: sr at domain.com/Spam: seq=2 uid=406: Expunge
Info: sr at domain.com/Spam: seq=3 uid=407: Expunge
Info: sr at domain.com/Spam: timestamp 1256710764 (Wed Oct 28 08:19:24 2009) -> 1256980000 (Sat Oct 31 11:06:40 2009)

> > If dovecot -n output is needed, please let me know.
> 
> If the above doesn't help, then yeah, dovecot -n and dovecot-ldap.conf
> contents.
> 
dovecot -n:
# 1.2.6: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.26-gentoo-r4 i686 Gentoo Base System release 1.12.11.1 
log_path: /var/log/dovecot/dovecot-error.log
info_log_path: /var/log/dovecot/dovecot.log
protocols: imaps managesieve
ssl_cert_file: /etc/ssl/dovecot/imaps.crt
ssl_key_file: /etc/ssl/dovecot/imaps.key
login_dir: /var/run/dovecot/login
login_executable(default): /usr/libexec/dovecot/imap-login
login_executable(imap): /usr/libexec/dovecot/imap-login
login_executable(managesieve): /usr/libexec/dovecot/managesieve-login
login_greeting: Server ready.
login_processes_count: 20
login_max_processes_count: 512
mail_max_userip_connections(default): 20
mail_max_userip_connections(imap): 20
mail_max_userip_connections(managesieve): 10
first_valid_uid: 8
last_valid_uid: 8
first_valid_gid: 12
last_valid_gid: 12
mail_drop_priv_before_exec: yes
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(managesieve): /usr/libexec/dovecot/managesieve
mail_plugins(default): quota imap_quota trash expire zlib autocreate virtual
mail_plugins(imap): quota imap_quota trash expire zlib autocreate virtual
mail_plugins(managesieve): 
mail_plugin_dir(default): /usr/lib/dovecot/imap
mail_plugin_dir(imap): /usr/lib/dovecot/imap
mail_plugin_dir(managesieve): /usr/lib/dovecot/managesieve
imap_client_workarounds(default): delay-newmail
imap_client_workarounds(imap): delay-newmail
imap_client_workarounds(managesieve): 
namespace:
  type: private
  separator: /
  location: maildir:~/data
  inbox: yes
  list: yes
  subscriptions: yes
namespace:
  type: private
  separator: /
  prefix: Company/
  location: virtual:/var/mail/virtual:INDEX=MEMORY:LAYOUT=maildir++
  list: yes
lda:
  postmaster_address: postmaster at domain.com
  hostname: mail.domain.com
  mail_plugins: quota trash expire sieve virtual
  quota_full_tempfail: yes
  sendmail_path: /usr/sbin/sendmail
  auth_socket_path: /var/run/dovecot/auth-master
  log_path: /var/log/dovecot/dovecot-deliver.log
  info_log_path: /var/log/dovecot/dovecot-deliver.log
  global_script_path: /etc/dovecot/sieve/default.sieve
  sieve_global_dir: /etc/dovecot/sieve
auth default:
  mechanisms: plain login
  default_realm: domain.com
  cache_size: 10240
  cache_negative_ttl: 0
  user: dovecot_auth
  master_user_separator: *
  worker_max_count: 50
  passdb:
    driver: passwd-file
    args: /etc/dovecot/passdb/master.pwd
    master: yes
  passdb:
    driver: passwd-file
    args: /etc/dovecot/passdb/users.pwd
  passdb:
    driver: ldap
    args: /etc/dovecot/dovecot-ldap.conf
  userdb:
    driver: prefetch
  userdb:
    driver: ldap
    args: /etc/dovecot/dovecot-userdb-ldap.conf
  userdb:
    driver: passwd-file
    args: /etc/dovecot/passdb/users.pwd
  socket:
    type: listen
    client:
      path: /var/run/dovecot/auth-client
      mode: 432
      user: mail
      group: dovecot_auth
    master:
      path: /var/run/dovecot/auth-master
      mode: 384
      user: mail
      group: mail
plugin:
  quota_warning: storage=90%% /etc/dovecot/plugins/quota_warning.sh 90
  quota: maildir:Mailbox quota
  quota_rule: *:storage=500M
  quota_rule2: Trash:storage=10%%
  trash: /etc/dovecot/plugins/dovecot-trash.conf
  expire: Trash 30 Spam 30
  expire_dict: proxy::expire
  autocreate: Drafts
  autocreate2: Sent
  autocreate3: Spam
  autocreate4: Trash
  autosubscribe: Drafts
  autosubscribe2: Sent
  autosubscribe3: Spam
  autosubscribe4: Trash
  sieve: ~/.dovecot.sieve
  sieve_dir: ~/sieve
  sieve_extensions: +notify
  sieve_before: /etc/dovecot/sieve/default.sieve
dict:
  expire: sqlite:/etc/dovecot/plugins/expire.conf

dovecot-ldap.conf:

uris = ldaps://off-dc-1 ldaps://off-dc-2
dn = imap@
dnpass = qweqwe
auth_bind = yes
ldap_version = 3
base = OU=Company,DC=company,DC=intranet
pass_attrs = =userdb_uid=8, =userdb_gid=12,=userdb_home=/data/mail/%d/%n, =userdb_mail=maildir:~/data, maxStorage=userdb_quota_rule=*:bytes=%$ 

pass_filter = (&(mail=%u)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))

user_attrs = =uid=8, =gid=12,=home=/data/mail/%d/%n, =mail=maildir:~/data, maxStorage=quota_rule=*:bytes=%$

user_filter = (&(mail=%u)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))


More information about the dovecot mailing list