[Dovecot] Postfix/Dovecot virtual - directory structure
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 can't figure out how to do it. The virtual_mail_base is /home/vmail/ but there I get a bunch of folders in the form [username]@[domain]. I use mysql for the virtual mailboxes if that matters.
I'll be grateful for any suggestions.
/Johan Folin
An easy way I found was to simply use the 'deliver' dovecot LDA instead of postfix. Then I just have it pull the mail path from the database.
Cassidy
On 12/22/06, Johan Folin <johan.folin@lsn.se> wrote:
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 can't figure out how to do it. The virtual_mail_base is /home/vmail/ but there I get a bunch of folders in the form [username]@[domain]. I use mysql for the virtual mailboxes if that matters.
I'll be grateful for any suggestions.
/Johan Folin
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
Luigi Rosa wrote:
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?
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]/ That was it! I had to adjust the select query in mysql_virtual_mailbox_maps.cf. Thanks for the help.
/Johan Folin
participants (3)
-
Cassidy B. Larson
-
Johan Folin
-
Luigi Rosa