dbpath = /etc/postfix/private/mail.sqlite query = SELECT coalesce(VM.vmUid, D1.domClass) FROM VMailbox AS VM JOIN Address AS A1 ON VM.vmNum=A1.addNum JOIN Domain AS D1 ON A1.addDomNum=D1.domNum WHERE A1.addLocalpart || '@' || D1.domName IS '%s' AND VM.active!=0 # Most howtos for Postfix virtual mailboxes, including the official # VIRTUAL_README document, use static maps for UID and GID: # virtual_uid_maps = static:5000 # virtual_gid_maps = static:5000 # This is easiest for usability, but exposes a potential security # weakness in that an exploit of the imapd or the virtual user/group # could lead to compromise or loss of all mailboxes. # # Here for the UID query, we use a default UID shared by all domains # under control of the same domSysUser. This UID owns and has u+rwx # privilege on /home/vmail/%d/, under which we deliver mail to %u/Mail/ # maildirs. This means that virtual(8) can create new mailboxes when # mail arrives.