Re: [exim] Quota Limits - Setting Greater Amounts

Top Page
Delete this message
Reply to this message
Author: Todd Lyons
Date:  
To: Brian Spraker
CC: exim-users
Subject: Re: [exim] Quota Limits - Setting Greater Amounts
On Thu, May 17, 2012 at 4:28 PM, Brian Spraker <spraker@???> wrote:
> I have a setup that checks a file for the quote size and I then use a MySQL backend with virtual users.  Here is a snippet of what I currently have:


Exactly what I do.

> maildir_format
> maildir_tag = ,S=message_size
> maildir_use_size_file = true
> maildir_quota_directory_regex = ^(?:cur|new|\..*)$
> current_directory = /
> quota = ${lookup mysql{SELECT quota FROM horde_users WHERE user_uid="${local_part}@${domain}"}{${value}999}}
> quota_warn_threshold = 90%
> quota_is_inclusive = false
> quota_warn_message = "\
> To: $local_part@$domain\n\
> Subject: Mailbox Approaching Size Limit (90% Usage)\n\n\
> Please note that your mailbox is approaching its limit.  Upon receiving this message, your mailbox was at 90% of capacity.\n"


Overall your setup is very similar to mine.

> However, please note that the "quota_warn_threshold" is set to an equal number as noted above.
> Sometimes a user receives a very large e-mail that puts them over their quota limit.  Does anyone know of a way to set it so that if the value is at 90% or GREATER, the message is sent out?


The code does in fact do this. From transports/appendfile.c:2953 in
current master:

  if (mailbox_size <= threshold && mailbox_size + message_size > threshold)
    addr->special_action = SPECIAL_WARN;


There's a special case though since you have quota_is_inclusive = false.

> In addition, once the individual has reached their quota limit, is there a way that a message saying "your mailbox is now closed" can be sent out?  I know that in an Exchange environment, that is possible.


That's an interesting option.

> I just have a few users that complain that they don't get the notice their mailbox is at 90% capacity and don't know that e-mails are bouncing because they have reached their limit.


You have quota_is_inclusive = false. The only thing I can conceive
that may be an issue is that one message comes in when it's at 89% or
less, and that one message is bigger than the 11% remaining. The
message gets delivered and the account is over-quota, but the warning
message never got generated because the state of the mailbox never was
in the range of 90-99%, where it would be detected and the warning
message generated. I've not yet evaluated whether this is actually
the flow of the code, so take it with a grain of salt.

...Todd
--
Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. -- Martin Golding