Sun Java System Messaging Server 6.3 Administration Guide

20.8 About Message Store Quotas

With the explosion of email and voice mail, IMAP mailboxes can grow very large. Message store quotas limit, or quota, for how much disk space or how many messages can be held by a user or domain, are in a specific folder, or are of a specific message type. Quotas are used to limit or reduce message store usage. This section contains information about the following:

For further information, see 20.11.4 To Monitor Quota Limits

20.8.1 Quota Overview

Quotas can be set for specific users or domains and can be set in terms of number of messages or number of bytes. It can also be set for specific folders and message types. Message type quotas allow you to specify limits for message type. For example, voice mail and email. Folder quotas set limits to the size of a user's folder in bytes or messages. For example, a quota can be set on the Trash folder. Messaging Server allows you to set default quotas for domains and users as well as customized quotas.

Once a quota is set, how the system responds to users or domains that are either over quota or approaching the quota is also configurable. One response is to send users an over quota notification. Another response is to halt delivery of messages into the message store when quota is exceeded. This is called quota enforcement and usually occurs after a specified grace period. A grace period is how long the mailbox can be over the quota before enforcement occurs. If message delivery is halted due to over quota, incoming messages remain in the MTA queue until one of the following occurs:

Disk space becomes available when a user deletes and expunges messages or when the server deletes messages according to expiration policies established (see 20.9 To Set the Automatic Message Removal (Expire and Purge) Feature).

20.8.1.1 Exceptions for Telephony Application Servers

To support unified messaging requirements, Messaging Server provides the ability to override quota limitations imposed by the message store. This guarantees the delivery of messages that have been accepted by certain agents, namely telephony application servers (TAS). Messages accepted by a TAS can be routed through a special MTA channel that ensures the message is delivered to the store regardless of quota limits. This is a fairly esoteric usage, but can be used to telephony applications. For more information about configuring an TAS channel, contact your Sun messaging representative.

Quota by message type is useful for telephony applications that use unified messaging. For example, if a mix of messages, say text and voice mail, is stored in a user's mailbox, then the administrator can set different quotas for different types of messages. The user's email can have one quota, and their voice mail can have a different quota.

20.8.2 Quota Theory of Operations

Customized user and domain quotas are specified by adding quota attributes to LDAP user and domain entries. Quota defaults, notification policy, enforcement, and grace period are specified in configutil parameters or by using the imquotacheck utility.

To determine if a user is over quota, Messaging Server first checks to see if a quota has been set for the individual user. If no quota has been set, Messaging Server looks at the default quota set for all users. For a user, the quota is for all the cumulative bytes or messages in all of the user's folders. For a domain, the quota is for all the cumulative bytes or messages of all the users in a particular domain. For a message type, the quota is for all the cumulative bytes or messages for that message type. For a folder, the quota is for all the cumulative bytes or messages for user's folder.

You can specify the following quota values for a user's mailbox tree:

The following guidelines apply when you assign multiple quota values for a user:

Changes made to the quota attributes and configutil parameters will take effect automatically, but not immediately as information is stored in caches and it may take a little time before the changes fully take effect. Messaging Server provides a command, iminitquota in Sun Java System Messaging Server 6.3 Administration Reference that updates the changed immediately.

The imquotacheck utility allows you to check message store usage against assigned quotas.

20.8.3 Message Store Quota Attributes and Parameters

This section lists the major the message store quota attributes and configutil parameters. The intention is to provide you with an overview of the functionality interface. For detailed information on these attributes and parameters, refer to the appropriate reference documentation.

The following table lists the quota attributes. Refer to the Sun Java Communications Suite 5 Schema Reference

Table 20–6 Message Store Quota Attributes

Attribute  

Description  

mailQuota

Bytes of disk space allowed for the user’s mailbox.  

mailMsgQuota

Maximum number of messages permitted for a user. This is a cumulative count for all folders in the store.  

mailUserStatus

Status of the mail user. Some of the possible values are active, inactive, deleted, hold, and overquota.

mailDomainDiskQuota

Bytes of disk space allowed for the cumulative count of all the mailboxes in a domain.  

mailDomainMsgQuota

Maximum number of messages permitted for a domain, that is, the total count for all mailboxes in the store. 

mailDomainStatus

Status of the mail domain. Values and default are the same as mailUserStatus.

The following table lists the quota parameters. Refer to the Chapter 3, Messaging Server Configuration, in Sun Java System Messaging Server 6.3 Administration Reference for the latest and most detailed information.

Table 20–7 Message Store configutil parameters

Parameter  

Description  

store.quotaenforcement

Enable quota enforcement When off, the quota database is still updated, but messages are always delivered. Default: On 

store.quotanotification

Enable quota notification. Default: OFF 

store.defaultmailboxquota

Store default quota by number of bytes. Default: -1 (unlimited) 

store.defaultmessagequota

Store default quota by number of messages. Numeric. Default: -1 (unlimited) 

store.quotaexceededmsg

Quota warning message. If none, notification is not sent. Default: None. 

store.quotaexceededmsginterval

Interval, in days, for sending overquota notification. Default: 7 

store.quotagraceperiod

Time, in hours, a mailbox has been overquota before messages to the mailbox will bounce back to the sender. Number of hours. Default: 120 

store.quotawarn

Quota warning threshold. Percentage of quota exceeded before clients are sent an over quota warning. Default: 90 

local.store.quotaoverdraft

Used to provide compatibility with systems that migrated from the Netscape Messaging Server. When ON, allow delivery of one message that puts disk usage over quota. After the user is over quota, messages are deferred or bounced, the quota warning message is sent, and the quota grace period timer starts. (The default is that the quota warning messages are sent when the message store reaches the threshold.) Default: Off, but is treated as on if local.store.overquotastatus is set, otherwise the user can never go over quota and the overquotastatus is never used.

local.store.overquotastatus

Enable quota enforcement before messages are enqueued in the MTA. This prevents the MTA queues from filling up. When set, and a user is not yet over quota, but an incoming message pushes the user over quota, then the message is delivered, but the mailuserstatus LDAP attribute is set to overquota so no more messages will be accepted by the MTA. Default: off 

Message store quota also includes a couple of utilities. iminitquota in Sun Java System Messaging Server 6.3 Administration Reference initializes quota settings. In other words, quota attributes and configutil parameters will take effect automatically after running this command. The changes would take effect without running this, but not immediately, as information is stored in caches and it will take a little time before the changes take effect.

The imquotacheck utility allows you to check message store usage against assigned quotas.

20.8.4 Configuring Message Store Quotas

This section describes the following tasks:

20.8.4.1 To Specify a Default User Quota

A default quota applies to users who do not have individual quotas set in their LDAP entries. The process consists of two steps: 1) Specifying a user default quota and 2) Specifying which users are bound to the default quota. The following examples show how to set default user quotas. Refer to Chapter 3, Messaging Server Configuration, in Sun Java System Messaging Server 6.3 Administration Reference for detailed parameter information.

To specify a default user disk quota for message size in bytes:

configutil -o store.defaultmailboxquota -v [ -1 | number ]

where -1 indicates no quota (unlimited message usage) and number indicates a number of bytes.

To specify a default user quota for total number of messages:

configutil -o store.defaultmessagequota -v [ -1 | number ]

where -1 indicates no quota (unlimited messages) and number indicates the number of messages.

To specify the default quota for specific users:

Set the mailQuota attribute to -2 in the user entries that use the default message store quota. Note that if mailQuotais not specified, the system default quota is used.

20.8.4.2 To Specify Individual User Quotas

Each user can have individualized quotas. To set user-specific quotas, set the mailQuota in Sun Java Communications Suite 5 Schema Reference or mailMsgQuota in Sun Java Communications Suite 5 Schema Reference attributes in the user’s LDAP entry (see configutil Parameters in Sun Java System Messaging Server 6.3 Administration Reference for complete details). The following examples show how to set user quotas.

To specify the system default quota, do not add mailQuota to the LDAP entry, or set it to –2.

To set the quota to 1,000 messages set mailMsgQuota to 1000.

To set the quota to two megabytes set mailQuota to 2M or 2000000.

To set the quota to two gigabytes, set mailQuota to 2G or 2000000000 or 2000M.

To specify a 2 Gigabyte quota; a 20 Megabyte voice mail quota; and a 100 Megabyte quota for the Archive folder:

mailQuota: 2G;#voice%20M;Archive%100M

The two gigabyte quota represents all folders in the user's mailbox that are not explicitly assigned quotas. In this example, that excludes messages in the Archive folder, and messages of type voice. The 100 Megabyte quota includes messages in any folders within the Archive folder

20.8.4.3 To Specify Domain Quotas

You can set disk space or message quotas for domains. These quotas are for the cumulative bytes or messages of all users in a particular domain. To set domain quotas, set the mailDomainDiskQuota in Sun Java Communications Suite 5 Schema Reference or mailDomainMsgQuota in Sun Java Communications Suite 5 Schema Reference attributes in the desired LDAP domain entry. .

To set the quota to 1,000 messages set mailDomainMsgQuota to 1000.

To set the quota to two megabytes set mailDomainDiskQuota to 2M or 2000000.

To set the quota to two gigabytes, set mailDomainDiskQuota to 2G or 2000000000 or 2000M.

ProcedureTo Setup Quota Notification

Quota notification is the process of sending users a warning message when they are getting close to their quota. Using this feature requires three steps.

  1. Enable Quota Notification

    Run the following at the command line:

    configutil -o store.quotanotification -v [ yes | no ]

    If the message is not set, no quota warning message is sent to the user.

  2. Define a Quota Warning Message

    The Warning Message is the message that will be sent to users who are close to exceeding their disk quota. To define a quota warning message at the command line:

    configutil -o store.quotaexceededmsg -v ’message

    The message must be in RFC 822 format. It must contain a header with at least a subject line, follow by $$, then the message body. ’$’ represents a new line. Depending on the shell that you are using, it might be necessary to append a \ before $ to escape the special meaning of $. ($ is often the escape character for the shell.) Example:

    configutil -o store.quotaexceededmsg -v ”Subject: WARNING: User quota exceeded$$User quota threshold exceeded - reduce space used.’

    In addition, there is support for the following variables:

    [ID] - userid

    [DISKUSAGE] - disk usage

    [NUMMSG] - number of messages

    [PERCENT] - store.quotawarn percentage

    [QUOTA] - mailquota attribute

    [MSGQUOTA] - mailmsgquota attribute

    Here’s an example, using these variables:

    configutil -o store.quotaexceededmsg -v ”Subject: Overquota Warning$$[ID],$$Your mailbox size has exceeded [PERCENT] of its alloted quota.$Disk Usage: [DISKUSAGE]$Number of Messages: [NUMMSG]$Mailquota: [QUOTA]$Message Quota: [MSGQUOTA]$$-Postmaster’

  3. Specify how often the warning message is sent.

    Set the following parameter:

    configutil -o store.quotaexceededmsginterval -v number

    where number indicates a number of days. For example, 3 would mean the message is sent every 3 days.

  4. Specify a Quota Threshold

    A quota threshold is a percentage of a quota that is exceeded before clients are sent a warning. When a user’s disk usage exceeds the specified threshold, the server sends a warning message to the user.


    Note –

    When local.store.quotaoverdraft=on email notifications are not triggered until the user’s disk usage exceeds 100% of the quota regardless of the threshold set with store.quotawarn.


    For IMAP users whose clients support the IMAP ALERT mechanism, the message is displayed on the user’s screen each time the user selects a mailbox and a message is also written to the IMAP log.

    To specify a quota threshold at the command line:

    configutil -o store.quotawarn -v number

    where number indicates a percentage of the allowed quota.

20.8.4.4 To Enable or Disable Quota Enforcement

By default, users or domains can exceed their quotas with no effect except for receiving an over quota notification (if set). Quota enforcement locks the mailboxes from receiving further messages until the disk usage is reduced below the quota level.

To enable or disable quota enforcement:


configutil -o store.quotaenforcement -v [ on | off]

Note that over quota messages are saved in the MTA queues and a notification is sent to the sender stating that their messages was not delivered, but that a redelivery attempt will be made later. Delivery retries will continue until the grace period expires and all messages are sent back to the senders, or the disk usage falls below the quota and messages can be dequeued from the MTA and delivered to the message store. If you want to return messages that are over quota before they get to the message queues, use the following command line:


configutil -o local.store.overquotastatus -v on

To Enable Quota Enforcement at the Domain Level

To enforce quotas for a particular domain, use the command:

imquotacheck -f -d domain

To enable for all domains exclude the -d option. When a domain exceeds its quota, the maildomainstatus attribute is set to overquota, which halts all delivery to this domain. If a domain is not overquota, the value is set to active.

Disabling Quota Enforcement

If it appears that user quotas are being enforced, even when you have disabled them, check the following parameters:

These configutil parameters should be off or not set:

Note that when local.store.overquotastatus is on, it always treats store.quotaoverdraft as on, otherwise the user will never go over quota to trigger the rejection. Also, when store.quotaoverdraft is on, the user is allowed one message which is smaller than the quota only. That is, it will never accept a message that is greater than the user’s quota.

After making changes to these parameters, be sure to restart your messaging services.

These Message Store attributes should be active:

Note that messages will bounce if they are larger than the mailbox quota, regardless of quota enforcement configuration.

20.8.4.5 To Set a Grace Period

The grace period specifies how long the mailbox can be over the quota (disk space or number of messages) before messages are bounced back to sender. The grace period is not how long the message is held in the message queue, it’s how long the mailbox is over quota before all incoming messages, including those in the message queue, are bounced. (see 20.1 Overview for more details.) The grace period starts when the user has reached the quota threshold and been warned. See To Setup Quota Notification.

To specify a quota grace period at the command line:

configutil -o store.quotagraceperiod -v number

where number indicates number of hours.

20.8.4.6 Netscape Messaging Server Quota Compatibility Mode

After disk usage exceeded the quota in the Netscape Messaging Server, the server deferred or bounced message delivery, sent an over quota notification, and started the grace period. Messaging Server provides a parameter, local.store.quotaoverdraft, which retains this behavior.

When set to ON, messages are delivered until disk usage is over quota. At that time, messages are deferred (messages stay in the MTA message queue but are not delivered to the message store), an over quota warning message is sent to the user, and a grace period starts. The grace period determines how long a mailbox is overquota before the overquota messages bounce. (The default is that the quota warning messages are sent when the message store reaches the threshold.) The default for this parameter is Off.