Johan Folin said the following On 23/12/2006 0:14:
Hi, perhaps I should post this in a Postfix forum but I'll give it a shot: I want my accounts sorted under /home/vmail/[domain]/[username] (and I managed to get Dovecot to look for mail there with %d and %n ), but how do I tell Postfix to sort the mail?
I am setting up a server with exactly this configuration with maildir storage. I am using MySQL for user authentication/management.
I set up a user list with this structure:
+----------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+--------------+------+-----+---------+----------------+ | idutente | int(11) | | PRI | NULL | auto_increment | | email | varchar(100) | | MUL | | | | uid | int(11) | | | 999 | | | gid | int(11) | | | 999 | | | homedir | varchar(200) | | | | | | maildir | varchar(200) | | | | | | password | varchar(50) | | | | | | attivo | char(1) | | | Y | | | dominio | varchar(50) | | | | | +----------+--------------+------+-----+---------+----------------+
This is an example of the table content:
email: u1@test.info uid: 999 gid: 999 homedir: /var/spool/mail/test.info/u1 maildir: test.info/u1/ password: test attivo: Y
email: u2@test.info uid: 999 gid: 999 homedir: /var/spool/mail/test.com/u2 maildir: test.com/u2/ password: test attivo: Y
In Postfix I use this query:
SELECT maildir FROM users WHERE email='%s' AND attivo='Y'
In Dovecot the querys are:
password_query = SELECT email AS user, password FROM users WHERE email='%u' AND attivo='Y'
user_query = SELECT uid,gid,homedir AS home, CONCAT('/var/spool/mail/',maildir) AS mail FROM users WHERE email='%u' AND attivo='Y'
Maildir are in /var/spool/mail/[domain]/[user]/
Ciao, luigi
-- / +--[Luigi Rosa]-- \
I got the bill for my surgery. Now I know what those doctors were wearing masks for. -- James Boren