Postfix does not support mailbox quota. But thanks to Anderson Nadal’s Postfix Virtual Delivery Agent (VDA) patches, it can. To use the Postfix VDA requires two things, first Postfix must be built with the VDA patches and second, virtual user accounts must be used. You can get the Postfix RPM with VDA patches here.

Here are some configuration you can use for your virtual accounts.

Configure Postfix VDA

Edit main.cf1. Edit the postfix configuration file /etc/postfix/ and add the lines below
virtual_mailbox_limit_override = yes
virtual_overquota_bounce = yes
virtual_mailbox_limit_maps = hash:/etc/postfix/vquota
Edit main.cf2. Create the file /etc/postfix/vquota containing the mapping from an email address to the maximum mailbox quota in bytes. If you wish to be exact, 1KB equals 1024 bytes while 1MB equals 1024KB or 1048576 bytes.
johndoe@acme.local 10485760
janedoe@acme.local 2097152

John Doe got a 10MB quota while Jane Doe got 2MB.

After creating this file, execute postmap /etc/postfix/vquota. This will generate /etc/postfix/vquota.db, the actual file that will be used for the lookup.

NoteIf you use Active Directory as your Postfix virtual user accounts source, you can use the maxStorage attribute instead to store the quota. Just copy your configuration and save it as Next change samaccountname to maxstorage in the result_attribute line and remove the result_format line. In your, use ldap:/etc/postfix/ as your virtual_mailbox_limit_maps. In Windows, you can use ADSI Edit to access and modify the value of maxStorage.

Service Configuration3. Restart the Postfix or MailScanner service if you have installed MailScanner. Learn how to start and stop services here.
Terminal4. Test Postfix using Telnet. Try using a very small quota limit so you can test the quota feature.

Visit the forum to ask for help or to give a comment.

Posted on 4/20/2008 and last updated on 6/26/2010
Filed under Postfix