1

Topic: Quota flow?

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): SQL
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro? yes
- Related log if you're reporting an issue:
====

I made a quick test and set a low quota of 20MB for my account (has 34MB of emails ). Then I sent from gmail an email to my account. What happend:

- gmail sender got a message "Your message to <xxxxxxx> was automatically rejected: Quota exceeded (mailbox for user is full)"
- recipient account didn't get any warnings

1.) Where can I change the message sender receives?

2.) Why recipient didn't get any warnings? Is this a cron based action? How can I simulate warnings?

3.) Once I get warnings, where can I change the text?


Thanks for your help.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Quota flow?

Peter wrote:

- gmail sender got a message "Your message to <xxxxxxx> was automatically rejected: Quota exceeded (mailbox for user is full)"
- recipient account didn't get any warnings
1.) Where can I change the message sender receives?

This message is sent by Dovecot since we use it as LDA (local deliver agent), As far as i know, it doesn't support custom this rejection message. You can try to search its wiki site or ask mailing list. http://wiki2.dovecot.org/

Peter wrote:

2.) Why recipient didn't get any warnings? Is this a cron based action? How can I simulate warnings?

iRedMail configures Dovecot to warn user when mailbox is 85%, 90%, 95% full (search 'quora_warning' in /etc/dovecot/dovecot.conf), but if you set mailbox quota to 20MB when it has already 34MB, there's no chance to become 85/90/95% full at all, so it won't trigger quota warning message.

This is clearly explained in Dovecot wiki site: http://wiki2.dovecot.org/Quota/Configur … a_warnings

You can configure Dovecot to run an external command when user's quota exceeds a specified limit. Note that the warning is ONLY executed at the exact time when the limit is being crossed, so when you're testing it you have to do it by crossing the limit by saving a new mail. If something else besides Dovecot updates quota so that the limit is crossed, the warning is never executed.

3 (edited by Peter 2015-07-03 17:30:11)

Re: Quota flow?

After a few tests here my results:

Dovecot quote message handling could be improved:

1.) send message to owner of full email (>= 100%)
2.) get mailbox warnings even though mailbox is full. In my tests somebody sent me an email with huge attachement after that my mailbox was full. I got only one message about 85% full! In fact is was 105% full.
3.) customize quota email messages. Here we go:

Mailbox warnings

Owner get a warning if mailbox reaches 85%, 90% and 95% (exception see 2. above)

# vi /usr/local/bin/dovecot-quota-warning.sh

... you can change text there!

Mailbox is full

Owner of Mailbox doesn't get any message only sender. Message can be customized:

# vi /etc/dovecot/dovecot.conf

plugin {
    auth_socket_path = /var/run/dovecot/auth-master

    ...
    ...

    quota_exceeded_message = Recipients mailbox is full!

# service dovecot restart

4 (edited by Peter 2015-07-03 18:30:15)

Re: Quota flow?

About problem 2.)

Dovecot wiki: Only the command for the first exceeded limit is executed, so configure the highest limit first.

Please change the order in /etc/dovecot/dovecot.conf to:

quota_warning = storage=95%% quota-warning 95 %u
quota_warning2 = storage=90%% quota-warning 90 %u
quota_warning3 = storage=85%% quota-warning 85 %u

5

Re: Quota flow?

Peter wrote:

1.) send message to owner of full email (>= 100%)

How can you deliver warning message to his mailbox since it's 100% full?

I want to remind that usually mailbox will reach X% (e.g. 80/85/90%) first, not the way how you test it (set quota to 20MB but it already has 34MB messages), so quota warning usually works. Even if the quota is now 70%, and you send a very large message and exceed the quota, quota warning will also be triggered. So, i don't see why we need to warn user after it's 100% full.

Peter wrote:

3.) customize quota email messages. Here we go:

Good catch. I will update Dovecot sample config file to use this setting. Thanks for sharing.

BTW, did you test exceeded message with single quote? does it work? for example:

    quota_exceeded_message = Recipient's mailbox is full!

6

Re: Quota flow?

Peter wrote:

Dovecot wiki: Only the command for the first exceeded limit is executed, so configure the highest limit first.

I just read this on wiki page too, i will fix it in next iRedMail release.

7

Re: Quota flow?

ZhangHuangbin wrote:

How can you deliver warning message to his mailbox since it's 100% full?

See quote grace http://wiki2.dovecot.org/Quota/Configur … uota_grace, 10% are set by default.


ZhangHuangbin wrote:

BTW, did you test exceeded message with single quote? does it work? for example:

    quota_exceeded_message = Recipient's mailbox is full!

No I use another text in another language. Don't know if this could cause problems.

8

Re: Quota flow?

Since Dovecot-2.2 has 10% (reasonable) by default, i prefer to use default Dovecot setting and don't set quota grace in dovecot.conf.

9

Re: Quota flow?

UPDATE: Fixed incorrect quota warning priorities moment ago:
https://bitbucket.org/zhb/iredmail/comm … 2023ffb8d3

10

Re: Quota flow?

Thanks.

With this setting the last warning message after a full mailbox is about 95% full. In my opinion it's important to tell customers it's now definitely 100% full. With this setting and default quota grace of 10% it works as expected

    quota_warning  = storage=100%% quota-warning 100 %u
    quota_warning2 = storage=95%% quota-warning 95 %u
    quota_warning3 = storage=85%% quota-warning 85 %u

I tested and got the last email AND the message about 100% full.

11

Re: Quota flow?

OK, i updated default config file with 4 rules: 85%, 90%, 95%, 100%.

    quota_warning = storage=100%% quota-warning 100 %u
    quota_warning2 = storage=95%% quota-warning 95 %u
    quota_warning3 = storage=90%% quota-warning 90 %u
    quota_warning4 = storage=85%% quota-warning 85 %u

12

Re: Quota flow?

Brilliant, you can close this topic.