[Dovecot] What best decision to make for flatfiles or SQL when I use Dovecot2 + Postfix together?

Tom Hendrikx tom at whyscream.net
Tue Sep 27 20:29:25 EEST 2011


On 27/09/11 17:51, terryjames9461 at mm.st wrote:
> Hello,
> 
> I'm moving my mail server from Exchange to an opensource one.
> 
> After a bunch of reading, I decided on building a Dovecot2 + Postfix
> server in a VirtualUsers-only + Multiple-domains configuration.
> 
> Since my messages will be stored by Dovecot, and the documentation is
> really good, I figured that it's smartest to configure Dovecot, then
> make Postfix 'fit' to it, sharing the data files that way.
> 
> I read through lots of the Dovecot wiki for v2.
> 
> There are many ways for storing the database data.  My goal is to only
> have data in one instances, used by both Postfix & Dovecot.
> 
> I'm a little confused about: to do that sharing-in-one-place, do I have
> to use SQL or can I use the flatfiles like passwd-db?   I think for sure
> someone already decided the best approach for this, and maybe I'm not
> understanding the logic to it.
> 
> The data I think I need to share are:
> 
>  users (user at domain.com)
>  passwords
>  user aliases (mapping user2 at domain.com -> user1 at domain.com)
>  domains
>  domain aliases (domain.com also receives email for domain2.com)
> 
> And I think all of this can be in passwd-db in Dovecot.  But I also want
> to make sure that Postfix ONLY accepts email for users/domains that
> exist, so it has to read that data too.
> 
> Can I do this that way with the flatfiles?  Or do I have to use the SQL
> approach?
> 

The problem with passwd(like) files is that they are almost never in the
correct format to fit both daemons. The easiest way to use a database.

You could check out postfixadmin: it contains the database format you
need, the documentation to hook postfix and dovecot into it, and a nice
web gui for administrating the list of domains, aliases, mailboxes,
passwords, etc etc.

--
Tom



More information about the dovecot mailing list