Re: [Dovecot] enabling per user quota plugin and problems with pop3

2012-08-24 Thread Angel L. Mateo

El 23/08/12 22:05, Timo Sirainen escribió:

On 20.8.2012, at 14.47, Angel L. Mateo wrote:


The origin of the problem why lmtp didn't use user's mail_plugin is 
that I had it configured it in the pass_attrs option (and read with prefetch) 
and not in user_attrs, so lmtp didn't get it.

But now the problem is that I can't configure mail_plugins redefinition 
per user with 'quota,imap_quota' because when it is get it for lmtp, it 
produces the error

Aug 20 13:38:30 myotis30 dovecot: lmtp(1086): Error: 
dlopen(/usr/lib/dovecot/modules/lib11_imap_quota_plugin.so) failed: 
/usr/lib/dovecot/modules/lib11_imap_quota_plugin.so: undefined symbol: 
client_send_tagline

and if I configure mail_plugins redefinition with just 'quota' then it 
is no applied for IMAP connections.


You can't do it with one passwd-file, you'd have to use multiple per-protocol 
passwd files.. For example:

userdb passwd-file {
   args = /etc/dovecot/passwd.%s
}


I have tried this option. It works, although I have to duplicate this 
file.

--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información   _o)
y las Comunicaciones Aplicadas (ATICA)  / \\
http://www.um.es/atica_(___V
Tfo: 868887590
Fax: 86337


Re: [Dovecot] enabling per user quota plugin and problems with pop3

2012-08-23 Thread Timo Sirainen
On 20.8.2012, at 14.47, Angel L. Mateo wrote:

   The origin of the problem why lmtp didn't use user's mail_plugin is 
 that I had it configured it in the pass_attrs option (and read with prefetch) 
 and not in user_attrs, so lmtp didn't get it.
 
   But now the problem is that I can't configure mail_plugins redefinition 
 per user with 'quota,imap_quota' because when it is get it for lmtp, it 
 produces the error
 
 Aug 20 13:38:30 myotis30 dovecot: lmtp(1086): Error: 
 dlopen(/usr/lib/dovecot/modules/lib11_imap_quota_plugin.so) failed: 
 /usr/lib/dovecot/modules/lib11_imap_quota_plugin.so: undefined symbol: 
 client_send_tagline
 
   and if I configure mail_plugins redefinition with just 'quota' then it 
 is no applied for IMAP connections.

You can't do it with one passwd-file, you'd have to use multiple per-protocol 
passwd files.. For example:

userdb passwd-file {
  args = /etc/dovecot/passwd.%s
}

Yeah, passwd-files aren't very flexible for things like these. Maybe you should 
look into using sqlite? It probably allows some if() or case() in the query (I 
haven't used sqlite).



[Dovecot] enabling per user quota plugin and problems with pop3

2012-08-20 Thread Angel L. Mateo

Hello,

	I am configuring quota plugin per user, not for the whole system. As 
documentation says (http://wiki2.dovecot.org/Quota), I have to add 
quota to the global mail_plugins and imap_quota to mail_plugins for 
protocol imap, but I don't know how to configure this in a userdb. I'm 
using a passwd-file in the way:


user:{plain}password:uid:gid::home::userdb_mail_plugins=quota,imap_quota

but this activate both plugins in the global mail_plugins option.

	The problem with this is that if the user tries to connect via pop3 
instead of imap (a thing that I permit, although the user shouldn't do 
it) I have the error:


Aug 20 10:04:18 myotis30 dovecot: pop3: Error: 
dlopen(/usr/lib/dovecot/modules/lib11_imap_quota_plugin.so) failed: 
/usr/lib/dovecot/modules/lib11_imap_quota_plugin.so: undefined symbol: 
client_send_tagline


is there any way to solve this problem?

--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868887590
Fax: 86337


Re: [Dovecot] enabling per user quota plugin and problems with pop3

2012-08-20 Thread Angel L. Mateo

Hi again,

	Another problem I'm having with this is that quota (maildirsize) is not 
updated when mail is delivered.


	According to 
http://wiki2.dovecot.org/Quota/Configuration#Per-user_quota I must be 
sure that dovecot-lda is run with -d option, but in my configuration I'm 
receiving mail via lmtp and (I think) dovecot-lda is not running at all.


	So the problem (I think) is that quota plugin is not used in the lmtp 
process. Is there any way to configure that lmtp processes use the 
mail_plugins in the userdb database?


--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868887590
Fax: 86337


Re: [Dovecot] enabling per user quota plugin and problems with pop3

2012-08-20 Thread Angel L. Mateo

El 20/08/12 12:56, Angel L. Mateo escribió:

Hi again,

 Another problem I'm having with this is that quota (maildirsize) is
not updated when mail is delivered.

 According to
http://wiki2.dovecot.org/Quota/Configuration#Per-user_quota I must be
sure that dovecot-lda is run with -d option, but in my configuration I'm
receiving mail via lmtp and (I think) dovecot-lda is not running at all.

 So the problem (I think) is that quota plugin is not used in the
lmtp process. Is there any way to configure that lmtp processes use the
mail_plugins in the userdb database?



I forgot to attach doveconf -n

--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868887590
Fax: 86337
# 2.1.5: /etc/dovecot/dovecot.conf
# OS: Linux 3.4.0-030400-generic x86_64 Ubuntu 12.04 LTS 
auth_cache_size = 20 M
auth_cache_ttl = 1 days
auth_debug = yes
auth_master_user_separator = *
auth_verbose = yes
default_process_limit = 1000
disable_plaintext_auth = no
log_timestamp = %Y-%m-%d %H:%M:%S
login_trusted_networks = 155.54.211.176/28
mail_debug = yes
mail_fsync = always
mail_location = maildir:~/Maildir:INDEX=/var/indexes/%n
mail_nfs_storage = yes
mail_privileged_group = mail
maildir_stat_dirs = yes
mdbox_rotate_size = 20 M
passdb {
  args = /etc/dovecot/master-users
  driver = passwd-file
  master = yes
  pass = yes
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf.ext
  driver = ldap
}
passdb {
  args = session=yes dovecot
  driver = pam
}
plugin {
  lazy_expunge = .EXPUNGED/ .DELETED/ .DELETED/.EXPUNGED/
  quota = maildir:User quota
  quota_rule = *:storage=10G
  quota_rule2 = Trash:storage=+1G
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
  sieve_extensions = +imapflags
  sieve_max_redirects = 15
  zlib_save = gz
  zlib_save_level = 6
}
postmaster_address = postmas...@um.es
service anvil {
  client_limit = 2003
}
service auth {
  client_limit = 3000
  unix_listener auth-userdb {
mode = 0666
  }
}
service doveadm {
  inet_listener {
port = 24245
  }
}
service imap {
  process_limit = 5120
  process_min_avail = 2
  vsz_limit = 512 M
}
service lmtp {
  inet_listener lmtp {
port = 24
  }
  process_min_avail = 10
  vsz_limit = 512 M
}
service pop3 {
  process_min_avail = 2
}
ssl = no
ssl_cert = /etc/ssl/certs/dovecot.pem
ssl_key = /etc/ssl/private/dovecot.pem
userdb {
  driver = prefetch
}
userdb {
  args = /etc/dovecot/dovecot-ldap.conf.ext
  driver = ldap
}
protocol lda {
  mail_plugins =  sieve
}
protocol lmtp {
  mail_plugins =  sieve
}
protocol pop3 {
  pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s, in=%i, out=%o
}
local 155.54.211.160/27/27 {
  doveadm_password = ]dWhu5kB
}