Hi Aki,

It works now with the commas!

Thanks

Le jeu. 22 nov. 2018 à 19:32, Aki Tuomi <aki.tuomi@open-xchange.com> a écrit :
I noticed that you sent replies to me directly...

Anyways, seems the problem was that the LDAP user_attrs is missing commas, and the mailRoutingAddress is used wrong, so the correct syntax would be:

user_attrs = \
   mailRoutingAddress=user, \
   =uid=vmail, \
   =gid=mail, \
   =home=/var/mail/%d/%n, \
   =quota_rule=*:bytes=%{ldap:departmentNumber}

Aki

> On 22 November 2018 at 15:29 Vincent Seynhaeve <vlamsdoem@gmail.com> wrote:
>
>
> doveadm quota recalc -u test doesn't give anything.
> Bellow the ouput of the `doveconf -n` and `doveadm user test`
>
> doveconf -n
> # 2.2.10: /etc/dovecot/dovecot.conf
> # OS: Linux 3.10.0-862.11.6.el7.x86_64 x86_64 CentOS Linux release 7.5.1804
> (Core)  xfs
> auth_debug = yes
> auth_mechanisms = plain login
> auth_verbose = yes
> mail_debug = yes
> mail_gid = mail
> mail_home = /var/mail/%d/%n
> mail_location = maildir:/var/mail/%d/%n/Maildir
> mail_plugins = " quota"
> mail_uid = vmail
> managesieve_notify_capability = mailto
> managesieve_sieve_capability = fileinto reject envelope encoded-character
> vacation subaddress comparator-i;ascii-numeric relational regex imap4flags
> copy include variables body enotify environment mailbox date ihave
> mbox_write_locks = fcntl
> namespace inbox {
>   inbox = yes
>   location =
>   mailbox Drafts {
>     special_use = \Drafts
>   }
>   mailbox Junk {
>     special_use = \Junk
>   }
>   mailbox Sent {
>     special_use = \Sent
>   }
>   mailbox "Sent Messages" {
>     special_use = \Sent
>   }
>   mailbox Trash {
>     special_use = \Trash
>   }
>   prefix =
> }
> passdb {
>   args = /etc/dovecot/dovecot-ldap.conf.ext
>   driver = ldap
> }
> plugin {
>   quota = maildir:User quota
>   quota_grace = 10%%
>   quota_rule2 = Trash:storage=+100M
>   quota_status_nouser = DUNNO
>   quota_status_overquota = 552 5.2.2 Mailbox is full
>   quota_status_success = DUNNO
>   sieve = ~/.dovecot.sieve
>   sieve_dir = ~/sieve
> }
> protocols = imap pop3 lmtp sieve
> service auth {
>   unix_listener /var/spool/postfix/private/auth {
>     group = postfix
>     mode = 0666
>     user = postfix
>   }
>   unix_listener auth-userdb {
>     group = mail
>     mode = 0600
>     user = vmail
>   }
> }
> service imap-login {
>   inet_listener imap {
>     port = 0
>   }
> }
> service managesieve-login {
>   inet_listener sieve {
>     port = 4190
>   }
> }
> service pop3-login {
>   inet_listener pop3 {
>     port = 0
>   }
>   inet_listener pop3s {
>     port = 0
>   }
> }
> ssl = required
> ssl_cert = </etc/pki/tls/certs/imap.example.com.crt
> ssl_key = </etc/pki/tls/private/imap.example.com.key
> userdb {
>   args = /etc/dovecot/dovecot-ldap.conf.ext
>   driver = ldap
> }
> protocol lda {
>   mail_plugins = " quota sieve"
> }
> protocol imap {
>   mail_plugins = " quota imap_quota"
> }
>
>
>
>
> doveadm user test
> field    value
> uid    vmail
> gid    mail
> home    /var/mail//test
> mail    maildir:/var/mail//test/Maildir
> mailRoutingAddress    user =uid=vmail =gid=mail =home=/var/mail//test
> =quota_rule=*:bytes=1M
>
>
> Le jeu. 22 nov. 2018 à 14:18, Aki Tuomi <aki.tuomi@open-xchange.com> a
> écrit :
>
> > Can you provide output of `doveconf -n` and `doveadm user test`?
> >
> > Aki
> >
> > > On 22 November 2018 at 10:44 Maciej Milaszewski IQ PL <
> > maciej.milaszewski@iq.pl> wrote:
> > >
> > >
> > > Hi
> > > Do you try recalc and get ?
> > >
> > > On 22.11.2018 08:56, Vincent Seynhaeve wrote:
> > > >
> > > > Hello,
> > > >
> > > > I'm trying to set up LDAP stored quota on Dovecot but it doesn't work
> > > > and doesn't get reported by the command doveadm quota get.
> > > >
> > > > I'm using the field departmentNumber in my LDAP server to store the
> > quota.
> > > >
> > > >
> > > > doveadm quota get -u test
> > > >
> > > > Quota name Type    Value
> > > >
> > Limit
> > > > %
> > > > User quota STORAGE     0
> > > >
> > -
> > > > 0
> > > > User quota MESSAGE     0
> > > >
> > -
> > > > 0
> > > >
> > > >
> > > > log file associated with doveadm quota get command:
> > > >
> > > > Nov 21 11:38:47 imap dovecot: auth: Debug: master in:
> > > > USER#0111#011test#011service=doveadm
> > > > Nov 21 11:38:47 imap dovecot: auth: Debug: ldap(test): user search:
> > > > base=ou=People,dc=example,dc=com scope=subtree
> > > > filter=(&(objectClass=posixAccount)(uid=test)) fields=departmentNumber
> > > > Nov 21 11:38:47 imap dovecot: auth: Debug: ldap(test): result:
> > > > departmentNumber=1M; departmentNumber unused
> > > > Nov 21 11:38:47 imap dovecot: auth: Debug: ldap(test): result:
> > > > departmentNumber=1M
> > > > Nov 21 11:38:47 imap dovecot: auth: Debug: userdb out:
> > > > USER#0111#011test#011mailRoutingAddress=user =uid=vmail =gid=mail
> > > > =home=/var/mail//test =quota_rule=*:bytes=1M
> > > >
> > > >
> > > > Bellow my configuration files:
> > > >
> > > > conf.d/10-mail.conf
> > > >
> > > > mail_plugins =  $mail_plugins quota
> > > >
> > > >
> > > > conf.d/20-imap.conf
> > > >
> > > >
> > > > protocol imap {
> > > >   mail_plugins = $mail_plugins imap_quota
> > > > }
> > > >
> > > >
> > > > conf.d/90-quota.conf
> > > >
> > > > plugin {
> > > >
> > > >   quota = maildir:User quota
> > > >   quota_rule2 = Trash:storage=+100M
> > > >   quota_grace = 10%%
> > > >   quota_status_success = DUNNO
> > > >   quota_status_nouser = DUNNO
> > > >   quota_status_overquota = "552 5.2.2 Mailbox is full"
> > > >
> > > > }
> > > >
> > > >
> > > > dovecot-ldap.conf.ext
> > > >
> > > > user_attrs= \
> > > > =mailRoutingAddress=user \
> > > > =uid=vmail \
> > > > =gid=mail \
> > > > =home=/var/mail/%d/%n \
> > > > =quota_rule=*:bytes=%{ldap:departmentNumber}
> > > >
> > > >
> > > > Can somebody help me with this or give me some advice for debugging?
> > > >
> > >
> > >
> > > --
> > > Maciej Miłaszewski
> > > IQ PL Sp. z o.o.
> > > Administrator Systemowy
> > >
> > > Biuro Obsługi Klienta:
> > > e-mail: bok@iq.pl
> > > tel.: +48 58 326 09 90 - 94
> > > fax: +48 58 326 09 99
> > >
> > > Dział pomocy: https://www.iq.pl/pomoc
> > > Informacja dotycząca przetwarzania danych osobowych:
> > https://www.iq.pl/kontakt
> > > Jakość gwarantuje: ISO 9001:2000
> > >
> > > IQ PL Sp. z o.o. z siedzibą w Gdańsku (80-298), ul. Geodetów 16, KRS
> > 0000007725, Sąd rejestrowy: Sąd Rejonowy w Gdańsku VII Wydział KRS,
> > > kapitał zakładowy: 140.000 PLN, NIP 5832736211, REGON 192478853
> > >
> >