[Dovecot] How to create home directories for virtual users?

Timo Sirainen tss at iki.fi
Thu Nov 24 21:29:46 EET 2011


On Thu, 2011-11-24 at 21:23 +0200, Olli Räisänen wrote:
> Tom Hendrikx kirjoitti 2011-11-24 kello 18:13:47:
> > 
> > How about using /srv/vmail/%d/%n for homedir, and /srv/vmail/%d/%n/mail
> > as mailstore?
> 
> Well, yes - at least the home directory will be created that way. Still, 
> PostfixAdmin will not store the path in the maibox table home field. Perhaps 
> it is enough to include the path in the Dovecot user_query?  

It would be better if you used PostfixAdmin's "maildir" field as the
home directory, and then mail_location=~/Maildir. Like the sql queries
being:

password_query = \
  SELECT username AS user, password, \
    CONCAT('/home/vmail/', maildir) AS userdb_home, \
    CONCAT('*:bytes=', quota) AS userdb_quota_rule \
  FROM mailbox \
  WHERE username = '%u' and ACTIVE = '1'

user_query = \
  SELECT CONCAT('/home/vmail/', maildir) AS home, \
    CONCAT('*:bytes=', quota) AS quota_rule \
  FROM mailbox \
  WHERE username = '%u' AND active = '1'

I used these in another PostfixAdmin server's install.





More information about the dovecot mailing list