Mail quota not updated if user quota changed

NethServer release 7.3.1611 (Final):

@dev_team If you have a mail quota in place a users mailbox will be listed under Mail quota as soon as there is mail in his mailbox.

Now, if you are going to change the users mail quota to a different value by using Custom mailbox quota the view under Mail quota is not updated any more and calculations done on this page are not correct, too for this user.
It’s always reproducible here (new user or existing user).

1 Like

Is it not updated even if the user logged in again?

correct, no update if done as admin. Also a server restart doesn’t change it.

But just recognised, that if the user with quota setting is logged into sogo it is updated!
What if the user has an imap connection?

And even more:
If the user is not logged in and the quota appears to be correct, then the next mail the users receives will reset the display to standard quota!

I was coming from NS6.8 and there it is updated as soon as the admin sets a new value.

Any IMAP connection should enforce the new quota. Sogo actually connects by IMAP.

This could be an issue…

Config has changed in the accounts DB. To accommodate with this, also the mail quota behaves differently.

try yourself, this is confusing if you can’t see the quotas set. Always good to hear if others can reproduce bugs - hope you can :sweat:

1 Like

This is really a big problem:

If you have a general quota of e.g. 2GB set and some users with a bigger personal quota (let’s say 5GB), then these users will not get mails anymore, because of the the bug which resets user quota to standard quota each time the user gets an email. Then a user with a 5GB Mailbox is over his limit and the sender will get this answer:

This is the mail system at host dc2.intern.org.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<testuser@intern.org>: host dc2.intern.org[/var/run/dovecot/lmtp] said: 552
    5.2.2 <testuser@intern.org> Quota exceeded (mailbox for user is full) (in
    reply to end of DATA command)

So user specific quotas can not be used at the moment!

2 Likes

Thank you for the report, @asl. I’ve just filed a new bug

Well, I’ve investigated the configuration and confirm the custom user quota is not enforced when a new message arrives (during delivery). Changing the current behavior to enforce the limit requires a major modification in the dovecot userdb configuration.

However I’m not sure enforcing the quota during delivery is a good solution, because IMO it’s better to deliver a message instead of accepting, discarding it and return a bounce to the sender. The message could be important.

Having said that, to get a more predictable behavior, I propose to change the general quota value applied by dovecot to be the maximum value between users custom quota and default quota. In this way, when connecting by IMAP the custom quota is applied, whilst when a message is delivered the “maximum” is applied.

For instance:

  • default 2GB, boss 7GB, guest 1GB
  • max(default, boss, guest) = 7GB

In this example every mailbox accepts new messages up to 7GB. When a default user or guest connects by IMAP see his mailbox full. He should delete some messages.

What do you think?

1 Like

+1
I second this proposal. :slight_smile:

I think this is not the expected behaviour of the quota management :slight_smile:
if I set 2 GB for all users and 30 for a special account, I don’t want all users to have 30 GB limit :slight_smile:

I think we should split the problem/solution into 2 parts:

1.) Repair view
If we set a custom quota, then we need to see this on the page for quotas. At them moment we usually do not see it there, because the user set quota gets changed to default as soon as a mail is received for his mailbox. Hope you can reproduce this. The quota page does not show much useful information at the moment.

2.) Setting a quota must have an effect
Usually I do this to force users to clean up their mailboxes. What we could do is:
a) send user a mail if his quota is nearly reached (e.g. <=10% capacity left)
b) block him from sending further messages if he reached his quota or before he reached it.
c) block incoming messages if mailbox is over quota
d) block incoming messages if mailbox over quota but notify admin or user, too

(a-b-c) is what exchange does (exchange knows a quota for not allowed to send any more and a higher quota where no messages are received any more) and this method does it’s job out in the field.


I think it’s not good to receive mails if mailbox is over the quota!! This would sooner or later fill up your entire HD.
And it’s also not good to assume the max quota found in the system as general max. This would be too much and again your HD would be out of storage. Let’s look to a setup with 100 Mailboxes most 1GB Limit some 5GB Limit. Let’s assume we have a 250GB HD. Mails would come in until Mailboxes filled up with 100*5GB =500GB, but your HD is 250GB only…

So my recommendation - keep it simple for the beginning:

  • repair view of quota page
  • do not accept mail from user or from outside if quota is over it’s limit (guess that’s how it is now and as it is done by most mail servers out)
  • we need to give user a chance to know about his quota. Sogo und Roundcube will show it anyway, but what if they are working with Thunderbird or pure imap? Thats why the should get a notification best before their box is filled up. To keep it simple the notification could be the warning sent out to sender if quota is reached.
2 Likes

This can be fixed. How to do it depends on the other issue.

Thanks for clarifying the expected behavior. What we are missing seems a “grace/soft” limit, that precedes the “hard” limit.

What I want to avoid is bouncing messages to foreign users, and a soft limit is what we need to do it.

The solution I propose is the simplest way to implement such limit with the current setup.

To implement what you describe more development is required.

1 Like

yes I agree with that. Would be best.

Hi @asl, I’ve a great update on this!

It should now be fixed by the package in nethserver-testing!

This has been fixed too!

I’ve found a simple solution, instead :sweat_smile: It implements the behavior as it was in ns6. Bounce messages are generated if user’s mailbox is over-quota.

The quota information is available via the IMAP quota extension. Any compatible client can display it. I think TB has a plugin for it.

About notification message: I think it’s a good idea, but I didn’t implement it with this bugfix. Please open a new topic in Feature category.

Please give a try to the testing package to confirm it actually fixes the issues you reported here:

yum --enablerepo=nethserver-testing update nethserver-mail-server

/cc @uliversal: this package contains also the fix for #5222
/cc @quality_team

3 Likes

Hello @davidep

I have updated my server an can report this:

  • If I want to see the correct Max. size in quota page of my already exiting users, I have to edit and submit each user mailbox. Reboot of mailserver service or server itself doesn’t do anything. This is not a problem but worth to know about. Same applies if you change the default quota later. This will not have an immediate effect on your existing mailboxes! My Impression was, that you said that this is fixed now?

  • Max. size is not changed for user root. This mailbox is still on the old default value of 2GB, even I do have 1.5GB as default now. I have no idea where to change this, but it is not important, too. Is it by design like this? The user root can be seen in Mail quota only.

  • Last not least there is a user vmail in Mail quota page with an old default vale of 5GB even I do have 1.5GB now. Where can I change this quota ? I think this is important, as shared Folders are part of daily life operations - so the should have a quota.

Pls. let me know your thoughts on that!
:strawberry:Good point about IMAP quota extension - I have to look about this…

2 Likes

No reboots needed. Existing installation should be fixed as follow:

  • accounts with custom quota: run once the command doveadm quota recalc -A (I could execute it automatically when the RPM is updated)
  • accounts with default quota (and custom quota, too): the next delivered message, or the next IMAP login should fix the quota value

root and vmail users have unlimited quota. This cannot be changed from the UI by now. The vmail account hosts the shared mailboxes. Both root and vmail: the next delivered message, or the next IMAP login should fix the quota value.

when I run cmd doveadm quota recalc -A I can see vmail and root max size as ‘-’ which seems to be unlimited and that is OK now.

But other things still not working for me. Here is what I did:

  1. Starting situation: default quota 900MB, user without custom mailquota, quota shows max size =900MB for user > correct :slight_smile:
  2. change custom mailquota for user to 1GB, quota shows still max size =900MB for user > as per design no immediate change :heavy_check_mark:
  3. incoming mail to user mailbox. quota should shows max size =1GB for user, but still 900 MB :warning:
  4. run cmd doveadm quota recalc -A . quota should shows max size =1GB for user, but still 900 MB :warning:

Can you reproduce this or is something totally wrong here on my setup?

2 Likes

When the default quota is applied, only the next IMAP login or the next incoming message refresh the mail quota status page: case 3 seems to fail here. :cold_sweat:

so you can reproduce 3.)?
and what about 4.)?

Next week I’ll try 3.

About 4: that command cannot work with default quota!