-*- text -*-

*DRAFT*DRAFT*DRAFT*DRAFT*DRAFT*DRAFT*DRAFT*DRAFT*DRAFT*DRAFT*DRAFT*DRAFT*

Cyrus Project                                                J. G. Myers
Carnegie Mellon                                               April 1994

			 IMAP QUOTA extension

Status of this memo

   This document describes an optional extension to the IMAP4
   protocol.  Distribution of this memo is unlimited.

   The protocol extension discussed in this document is experimental
   and subject to change.  Persons planning on either implementing or
   using this protocol extension are STRONGLY URGED to get in touch
   with the author before embarking on such a project.

Introduction

   The intent of the QUOTA extension to the Interactive Mail Access
   Protocol (IMAP4) is to allow administrative limits on resource
   usage (quotas) to be manipulated through the IMAP protocol.

   An IMAP server which supports the QUOTA extension may support
   limits on any number of resources.  Each resource has
   an atom name and an implementation-defined interpretation which
   evaluates to an integer.  Examples of such resources are:

	Name		Interpretation

	MESSAGE		Number of messages
	STORAGE		Sum of messages' RFC822.SIZE, in Kilo-characters

   Each mailbox has zero or more implementation-defined named "quota
   roots".  Each quota root has zero or more resource limits.  All
   mailboxes that share the same named quota root share the resource
   limits of the quota root.

   Quota root names do not necessarily have to match the names of
   existing mailboxes.

Commands

   tag SETQUOTA quota-root setquota_list

      The SETQUOTA command takes the name of a mailbox quota root and
      a list of resource limits.  The resource limits for the named
      quota root are changed to be the specified limits.  Any previous
      resource limits for the named quota root are discarded.

      If the named quota root did not previously exist, an
      implementation may optionally create it and change the quota
      roots for any number of existing mailboxes in an
      implementation-defined manner.

      Example:  A001 SETQUOTA "" (STORAGE 512)
		* QUOTA "" (STORAGE 10 512)
		A001 OK Setquota completed

   tag GETQUOTA quota-root

      The GETQUOTA command takes the name of a quota root and returns
      the quota root's resource usage and limits in an unsolicited
      QUOTA response.

      Example:  A003 GETQUOTA ""
		* QUOTA "" (STORAGE 10 512)
		A003 OK Getquota completed		

   tag GETQUOTAROOT mailbox

      The GETQUOTAROOT command takes the name of a mailbox and returns
      the list of quota roots for the mailbox in an unsolicited
      QUOTAROOT response.  For each listed quota root, it also returns
      the quota root's resource usage and limits in an unsolicited
      QUOTA response.

      Example:  A003 GETQUOTAROOT INBOX
		* QUOTAROOT MAILBOX ""
		* QUOTA "" (STORAGE 10 512)
		A003 OK Getquota completed		

   Responses

   * QUOTA astring getquota_list 

      This response occurs as a result of a GETQUOTA or GETQUOTAROOT
      command.  The string is the quota root for which this quota
      applies.

      The getquota_list is a S-expression format list of the resource
      usage and limits of the quota list.  The list contains zero or
      more triplets.  Each triplet conatins a resource name, the
      current usage of the resource, and the resource limit.

      Resources not named in getquota_list are not limited in the
      quota root.  Thus, an empty list means there are no
      administrative resource limits in the quota root.

   * QUOTAROOT astring 1#string

      This response occurs as a result of a GETQUOTAROOT
      command.  The first string is the mailbox and the remaining
      strings are the quota roots for the mailbox.

Formal syntax

   The following syntax specification uses the augmented Backus-Naur
   Form (BNF) notation as specified in RFC 822 with one exception; the
   delimiter used with the "#" construct is a single space (SP) and not
   a comma.

   getquota	   ::= "GETQUOTA" SP astring

   getquotaroot	   ::= "GETQUOTAROOT" SP astring

   quota_list	   ::= "(" 0#quota_resource ")"

   quota_resource  ::= string SP NUMBER SP NUMBER

   quota_response  ::= "QUOTA" SP astring SP quota_list

   quotaroot_response
		   ::= "QUOTAROOT" SP astring SP 0#astring

   setquota	   ::= "SETQUOTA" SP astring SP setquota_list

   setquota_list   ::= "(" 0#setquota_resource ")"

   setquota_resource ::= string SP NUMBER


Author's Address

   John G. Myers
   Carnegie-Mellon University
   5000 Forbes Ave.
   Pittsburgh PA, 15213-3890

   Email: jgm+@cmu.edu

