deliverquota delivers mail to a maildir with a software-imposed quota. The manually-enforced quota mechanism described in maildirquota(7). Instead of setting up your mail server to deliver the message to a maildir, set up the mail server to deliver the message to the deliverquota program, and specify the location of the maildir, and its corresponding quota, as the arguments.
deliverquota reads the message from standard input and delivers it to maildir. maildir may specify a path directly to a maildir folder, not the main maildir (as long as the folder was created by the maildirmake(1) command.
quota is a list of comma separated quota specifications. A quota specification consists of a number followed by either 'S', indicating the maximum message size in bytes, or 'C', maximum number of messages. For example:
This delivers to ./Maildir with the quota set to 5,000,000 bytes or 1000 messages, whichever comes first.
This delivers to ./Maildir with the quota set to 1,000,000 bytes, without limiting number of messages.
The -c option automatically creates the maildir, and all missing parent subdirectories (as 'mkdir -p'). This option should be used with caution.
The -w N option places a warning message into the maildir if the message was successfully delivered, but the maildir is now at least N percent full. The warning message is copied verbatim from /etc/quotawarnmsg with the addition of "Date:" and "Message-Id:" headers. The warning is repeated every 24 hours (at least), until the maildir drops below N percent full.