Installation:

1 - Get the Postfix source code ( http://www.postfix.org/ )
2 - Get this software ( http://vda.sourceforge.net ) for your Postfix version
3 - Unpack the source code: tar -xvzf postfix-VERSION.tar.gz
4 - Unpack the patch: gunzip postfix-VERSION-vda-ng-rREV.patch.gz
5 - Apply the patch: cd postfix-VERSION; patch -p1 < ../postfix-VERSION-vda-ng-rREV.patch
6 - Configure
7 - Make

Configuration:

#### Postfix main.cf

# I use only virtual as local delivery
mailbox_transport = virtual

# Base directory where the mailboxes are located 
virtual_mailbox_base = /var/virtualmail

# Virtual users maps
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
transport_maps = hash:/etc/postfix/vtransport

# Minimal permitted UID value (for virtual_uid_maps)
virtual_minimum_uid = 1000

# GIDs and UIDs to run as
# Can also be stored in hash, mysql, ...
virtual_uid_maps = static:4000
virtual_gid_maps = static:4000

# A maximum size limit for a mailbox
virtual_mailbox_limit = 100000000

# Quota values maps
virtual_mailbox_limit_maps = hash:/etc/postfix/vquota

# Limit only the INBOX
# (useful for when you have IMAP users)
virtual_mailbox_limit_inbox = no

# Enable limits smaller than maximum message size
virtual_mailbox_limit_override = yes

# Enable Maildir++ extensions for faster maildir quota calculation
# (maildirsize file and ",S=<size>" filename extension)
# Needs Maildir++ compatible IMAP servers, like Courier-IMAP
virtual_maildir_extended = yes

# Always bounce the message when quota reached
virtual_overquota_bounce = yes

# Custom message to send when bouncing
#virtual_maildir_limit_message = "Sorry, maximum quota reached!"

# Custom message maps for the bounces
#virtual_maildir_limit_message_maps = hash:/etc/postfix/vmsg

# Also count the Trash folder when calculating quotas?
virtual_trash_count = yes

# The name of the Trash folder
# (if it doesn't need to be calculated)
#virtual_trash_name = ".Trash"

# Enable the Maildirfilter feature
virtual_maildir_filter = yes

# Maildirfilter maps
virtual_maildir_filter_maps = hash:/etc/postfix/vfilter

#### Mailbox users file - vmailbox
user@domain.com.br     /path/to/mailbox - path relative to virtual_mailbox_base
user1@domain.com.br    /domain.com.br/user1 - no trailing slash, user has a MAILBOX
user2@domain.com.br    /domain.com.br/user2 - no trailing slash, user has a MAILBOX
user1@domain.net.br    /domain.net.br/user1/ - trailing slash, user has a MAILDIR
user2@domain.net.br    /domain.net.br/user2/ - trailing slash, user has a MAILDIR

#### Quota users file - vquota
user@domain.com.br     QUOTA IN BYTES
user1@domain.com.br    2048000 
user2@domain.com.br    2048000 
user1@domain.net.br    5192000
user2@domain.net.br    0 - NO QUOTA

#### Maildirfilter file - vfilter
# ATTENTION: the syntax for maildirfilter values is the following:
# the # sign, followed by a space, followed by a M (uppercase), then a modification time value
# (you need to change this when you change the regexps) made of a maximum of 10 digits, then a
# space again and an arbitrary number of regexps (a regexp always starts with /^ and ends with
# a space) and their corresponding actions
user@domain.com.br  # M<timestamp> regexp1 action1 regexp2 action2 ...
user1@domain.net.br # M2007022701 /^subject:.*BAD.*/m DISCARD /^from:.*user@domain.com.br*/m MOVE Trash
user2@domain.com.br # M2007022617 /^subject:.*Viagra.*/m REJECT /^subject:.*trash.*/m MOVE SpamFolder /^subject:.*pharmacy.*/m DISCARD

More informations can be found at http://vda.sourceforge.net
