[Dovecot] best choice of user database file to work with postfix?

Heiko Schlittermann hs at schlittermann.de
Thu Apr 22 00:45:24 EEST 2010


Hello Phil,

Phil Howard <ttiphil at gmail.com> (Mi 21 Apr 2010 16:32:36 CEST):
> I'm setting up a Postfix and Dovecot combination.  What I want to do is have
> a user database that (1) is not running from some engine (so not LDAP or SQL
> or such) ... and (2) is completely disassociated from system users (e.g.
> most email users are not in /etc/passwd and most /etc/passwd users are not
> email users).  Ideal would be a one-file solution, which can be managed by
> text editing or simple command line tools.  But what I want is ONE file that
> both Postfix (for valid recipients) and Dovecot (for user login

A recent demonstration of a German postfix expert used a sed-Script to
convert (basically cut everything behind the first „:“) the dovecot
passdb file to a postfix readable text file (and convert this to a
hash(?)).

I'm not sure, if postfix really can't read a passdb (passwd-like) file.
Probably it (postfix) isn't flexible enough for doing this, or the
expert didn't want to show it.

As an exim user I'd suggest using exim - and enjoing real flexiblity ;-)
The solution I'd prefer is (d) - it makes your exim independend on the
userdb/passdb used by dovecot, you're just talking to the auth-master.
(Something I'd implement additionally is a „softfail“ (4xx error) in
case the socket is not usable.)


# exim config snipped - the dovecot passdb is /etc/vmail/passwd

    # for better readability of the (d) alternative below (using
    # exims macro feature
    SOCKET  = /var/run/dovecot/auth-master
    REQUEST = VERSION\t1\t0\nUSER\t$pid\t$local_part\tservice=imap\n

    # local user router
    # chose (a), (b), (c), (d)
    vmail:
        driver = accept
        #(a) local_parts = lsearch;/etc/vmail/passwd
        #(b) condition = ${lookup{$local_part}lsearch{/etc/vmail/passwd}{true}}
        #(c) condition = ${lookup{$local_part@$domain}lsearch{/etc/vmail/passwd}{true}}
        #(d) condition = ${if match {${readsocket{SOCKET}{REQUEST}}} {(?m)^USER}}
        transport = dovecot

    # dovecot transport
    # dovecot uses uid vmail for accessing all mailboxes (userdb static)
    dovecot:
        driver = pipe
        command = /usr/lib/dovecot/deliver -d $local_part@$domain
        user = vmail

(…)
> smallish setup on one server, with probably a max of 50 to 100 users and 50
> or so role account mailboxes over the next year or two.  Any
> recommendations?

Use Exim ;-)

    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann HS12-RIPE -----------------------------------------
 gnupg encrypted messages are welcome - key ID: 48D0359B ---------------
 gnupg fingerprint: 3061 CFBF 2D88 F034 E8D2  7E92 EE4E AC98 48D0 359B -
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://dovecot.org/pipermail/dovecot/attachments/20100421/48f1d754/attachment.bin 


More information about the dovecot mailing list