Bug 38474 - Mail quota feature with Dovecot
Mail quota feature with Dovecot
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Mail - Dovecot
UCS 4.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: Daniel Tröder
Sönke Schwardt-Krummrich
:
: 38406 (view as bug list)
Depends on:
Blocks: 34839 38553
  Show dependency treegraph
 
Reported: 2015-05-06 19:28 CEST by Daniel Tröder
Modified: 2015-07-09 18:13 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2015-05-06 19:28:07 CEST
Use extended attributes in users/user. Can be read by Dovecot directly from LDAP.
Comment 1 Daniel Tröder univentionstaff 2015-05-22 13:33:01 CEST
*** Bug 38406 has been marked as a duplicate of this bug. ***
Comment 2 Daniel Tröder univentionstaff 2015-05-22 16:51:48 CEST
Commit: 60853

* Per-user quota configurable in UDM.
* Stores quota as (int) MB in LDAP attribute univentionMailUserQuota from univentionMail, which is attached to all users.
* Dovecot reads it directly from LDAP upon mailbox access.
* Dovecot uses maildir++ backend: writes stats into ~/Maildir/maildirsize
* Adds UCRVs mail/dovecot/quota/warning/subject and mail/dovecot/quota/warning/text/.* to configure warning mails if user gets over quota.

Read/list quotas on the command line with:
# doveadm quota get [-u <user>|-A]
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2015-07-03 15:31:01 CEST
(In reply to Daniel Tröder from comment #0)
> Use extended attributes in users/user. Can be read by Dovecot directly from
> LDAP.

→ made small text changes:
r61754 | Bug #38474: updated translation in extended attribute

→ extended attribute is not removed if last dovecot app in UCS domain has been 
  uninstalled → unjoin script should check that and remove ext attr if the last
  dovecot app is uninstalled
→ see ucs_isServiceUnused in developer guide
→ REOPEN

root@slave22b:~# univention-ldapsearch -LLL uid=user1 univentionMailUserQuota mailPrimaryAddress
dn: uid=user1,cn=users,dc=nstx,dc=local
mailPrimaryAddress: mail1@nstx.local
univentionMailUserQuota: 1234
root@slave22b:~# doveadm quota get -u mail1@nstx.local
Quota name Type    Value   Limit                   %
User quota STORAGE     0 1263616                   0
User quota MESSAGE     0       -                   0

1263616 == 1234 * 1024 → OK

Functionality tested by ./40_dovecot_quota and ./41_dovecot_quota-status from ucs-test (and manually). → OK

4
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2015-07-03 16:01:23 CEST
(In reply to Daniel Tröder from comment Bug 38406 #0)
> Trash folders should get a 110% quota, for clients that do move-to-trash
> before deleting, so user don't get the dreaded "cannot delete message,
> mailbox full" message.
> 
> Currently we have Dovecot 2.1 in UCS 4.0. With Dovecot 2.2 we'd get the
> "quota-status" policy service, that can tell Postfix that the users mailbox
> is full. Currently it will produce backscatter.

→ works as described
Comment 5 Daniel Tröder univentionstaff 2015-07-04 10:45:43 CEST
> → extended attribute is not removed if last dovecot app in UCS domain has
> been 
>   uninstalled → unjoin script should check that and remove ext attr if the
> last
>   dovecot app is uninstalled
> → see ucs_isServiceUnused in developer guide
> → REOPEN
fixed in commit 61765
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2015-07-06 22:08:45 CEST
(In reply to Daniel Tröder from comment #5)
> > → extended attribute is not removed if last dovecot app in UCS domain has
> > been 
> >   uninstalled → unjoin script should check that and remove ext attr if the
> > last
> >   dovecot app is uninstalled
> > → see ucs_isServiceUnused in developer guide
> > → REOPEN
> fixed in commit 61765

→ OK, join script is executed and extended attribute is removed.
→ VERIFIED
Comment 7 Janek Walkenhorst univentionstaff 2015-07-09 18:13:30 CEST
<http://errata.univention.de/ucs/4.0/237.html>