NOTICE
I am currently looking for a new maintainer for this patch. If someone like to take maintainership for this. Contact me (kiwi at oav dot net).
Description
I work for a ISP and I love postfix a lot.
The original Postfix Virtual Delivery Agent lacks from some features that are usefull for ISP's:
- Mailbox / Maildir size limit, known also as "soft quota", to avoid user take all you disk space
- Customizable "limit" message when the soft quota limit is reached. NOTE: message is sent to senders, but NOT to the owner of the mailbox.
- Limit only 'INBOX', because some people use IMAP and don't want the same limit in IMAP folder that are differents from INBOX.
- Support for 'Courier' style Maildir, usefull for people that use courier as pop3/imap server and to get fast soft quota summary. Note that it is also compatible with qmail maildir per default.
- Supports for Courier 'maildirsize' file in Maildir folder that is used to read quotas quickly. Note that this option is not actived per default and can be dangerous on some NFS client implementation (like for example Solaris that cache some filesystem operations).
- Customisable suffix for Maildir support, when share same external dict between postfix and pop3/imap server sometime "Maildir/" suffix is needed to avoid extra database handling (eg LDAP, MySQL...).
Incompatibilities
Starting with snapshot 20011210, a new map has been added to postfix. Since this release virtual_static_uidgid,virtual_static_uid and virtual_static_gid are now removed from this patch. Please use the map static instead.
Example :
# Before snap 20011210 virtual_static_uidgid = yes virtual_static_uid = 200 virtual_static_gid = 200 virtual_uid_maps = virtual_gid_maps =Now you can use :
# Starting with snap 20011210 virtual_uid_maps = static:200 virtual_gid_maps = static:200Which is much better for smaller configuration file and easier to understand.
New features
Now virtual handles uid/gid per domain. Thank to Matt <grpmind+postfix at boromir dot vpop dotnet> for this. Example :
# Postfix main.cf configuration file virtual_uid_maps = hash:/etc/postfix/uids virtual_gid_maps = hash:/etc/postfix/gidsIn maps :
# /etc/postfix/uids user@domain.com 10001 user@domain.net 10002 @dot.com 20001 @dot.net 20002
# /etc/postfix/gids user@domain.com 2000 user@domain.net 2000 @dot.com 5001 @dot.net 5002Have fun... :)
Added 12/08/2002: support for per domain softquotas, like this example :
virtual_mailbox_limit_maps = hash:/etc/postfix/vquotaIn the /etc/postfix/vquota:
user@dot.com 2000000 user@dot.net 2000000 @dot.com 5192000 @dot.net 8192000Warning: This will enabled only with postfix snapshots 200207019 or newer.
CVSWeb access
CVSweb is located Here
Patches for postfix releases and snapshots
-
Note 1: Starting with 2.0.11 release, MK2 options
are now included in mainstream patches. Enjoy !
- Postfix 2.0.16 Third party patch (Anderson Nadal) : ftp http
- Postfix 2.0.13.v2 Added option virtual_overquota_bounce option to configuration to bounce message when user is overquota, bounce the message allways (like patch for postfix < 2.0.10) : ftp http
- Postfix 2.0.13 : ftp http
- Postfix 2.0.12.v2 Second Release of the patch. Fix a memory problem. Please upgrade to this one or use 2.0.13 patch. : ftp http
- Postfix 2.0.10-mk2 MK2 version. Provide new features. See them : ftp http
- Postfix 2.0.10 : ftp http
- Postfix 2.0.9-mk2 MK2 version. Provide new features. See them : ftp http
- Postfix 2.0.9 (patch provided by Roman Korolyov - Thanks !) : ftp http
- Postfix 2.0.6-20030305 (note: not fully tested, maildir delivery works and tested, mailbox has NOT being tested.) : ftp http
- Postfix 2.0.6 : ftp http
- Postfix 2.0.3 (patch provided by Roman Korolyov - Thanks !) : ftp http
- Postfix 2.0.0.2 : ftp http
- Postfix 2.0.0.1 : ftp http
- Postfix 2.0.0 : ftp http
- Postfix 1.1.12 : ftp http
- Postfix 1.1.12 : ftp http
Note 2: Starting with 2.0.16, the patches are now provided in a random time basis because I have looking for a new maintainer for this work.
Readme from sources
VIRTUAL_README
Original patches and archives
- Orignal patches from Adrian Zurek are here
- Postfix snapshot 20010502 to 20011127 are now located here for historical reasons.
Sample configuration
Note that this configuration is just a dummy example I use for testing purposes, it can be used for understand better how this patch works
main.cf configuration
Here is in short the configuration for main.cf file :
# I use only virtual as localdelivery... This permit me to have full # virtual domain hosting without using a lots of maps mailbox_transport = virtual # All my virtuals users are located on a separate disk virtual_mailbox_base = /var/mailusers # Maps of virtuals users virtual_mailbox_maps = hash:/etc/postfix/vmailbox # All ids < 1000 are bad ids... virtual_minimum_uid = 1000 # I use same uid and gid for all my users virtual_uid_maps = static:4000 virtual_gid_maps = static:4000 # A maximum limit of a mailbox virtual_mailbox_limit = 100000000 # Limits only INBOX part (usefull when # using when you have IMAP users) virtual_mailbox_limit_inbox = yes # maps of soft disk quotas virtual_mailbox_limit_maps = hash:/etc/postfix/vquota virtual_mailbox_limit_override = yes # I use Courier IMAP compatibles files. virtual_maildir_extended = yes # Usefull for Courier IMAP.. virtual_maildir_suffix = Maildir/ # Generate maildirsize files or not virtual_create_maildirsize = yes
vmailbox maps file
The software diskquota can be user either on Maildir format or mailbox
# This are maibox users user1@domain.com com/d/do/domain.com/user1 user2@domain.com com/d/do/domain.com/user2 # This are Maidir users user1@domain.net net/d/do/domain.net/user1/ user2@domain.net net/d/do/domain.net/user2/
vquota maps file
This file contains in bytes the maximum diskspace authorised per emails.
# domain.com are unlucky one... they have a max to 2M diskquota user1@domain.com 2048000 user2@domain.com 2048000 # domain.net are more lucky... and some don't have any limits (0 !) user1@domain.net 5192000 user2@domain.net 0
And now ?
For this example I used flat files and hash: postfix dictionary, now you can use allmost every postfix dicts, like ldap, mysql, hash, static, tcp and so on.
Contact / Author
I'm not the author of Virtual Delivery Agent for Postfix. But this patch was make by me for my work needs. I was taken from a patch from Adrian Zurek (please have a look at the postfix-user mailing list for more information) that supported only mailbox format. I added support for maildir storage and few new options.
Flames, comments, (junk?) food can go there -> See mailing list below.
Mailing List
A mailing list has been setup. To subscribe send a mail to sympa@oav.net with in the subject or body : sub pfvda or go here to subscribe, get the archives etc... Please subscribe to this mailing list, because important updates, discussions or patches can be found here, as well as notifications of updates of this software. Please DO NOT send me direct emails about configurations, postfix hints, etc, use the mailing list instead (if you don't, I will get random time delay to respond to you).
TODO List
Well, there is a lots todo :
- Hoping that will be integrated into Postfix mainstream... Unfortunatly it seems that Wietse Venema doesn't want to do...
- Add a maps for bounce messages.
- Add support to customized bounce reason also on mbox supports
- Maybe move this patch into a "lmtp2virtual" delivery system, so it can be used on allmost MTA : postfix, sendmail, exim, .... ?
- Any other ideas?