[Dovecot] best choice of user database file to work with postfix?
Phil Howard
ttiphil at gmail.com
Wed Apr 21 23:34:30 EEST 2010
On Wed, Apr 21, 2010 at 3:30 PM, Thomas Leuxner <tlx at leuxner.net> wrote:
> I'm running a setup that should be good enough for what you are trying to
> achieve. All user information is stored in flat files per domain and you may
> override per user settings individually:
>
> passdb {
> args = username_format=%u /var/vmail/auth.d/%d/passwd
> driver = passwd-file
> }
>
> userdb {
> args = username_format=%u /var/vmail/auth.d/%d/passwd
> driver = passwd-file
> }
>
What does it take to get Postfix to read this?
$ cat passwd
> user at domain.tld:{scheme}<password>:5000:5000::/var/vmail/domain.tld/user::userdb_quota_rule=*:storage=5G
> userdb_acl_groups=PublicMailboxAdmins
>
In which directory was this?
> I would vote against storing aliases in these files though. Reason being
> the Postfix alias files are more flexible, because you would need to setup
> NULL password/No Login users or similar in the Dovecot backend. Another
> reason to keep them in Postfix is to completely separate alias management
> from the user management and use the same for login checks.
>
> See how aliases are used for routing and to authenticate valid mail from
> senders with one file:
>
> $ cat virtual
> alias at domain.tld login at domain.tld
> postmaster at domain.tld login at domain.tld
>
I suspect I will want to be maping virtuals between different domains, so I
might have
abuse at example.com mailadmin at example.net
abuse at example.net mailadmin at example.net
postmaster at example.com mailadmin at example.net
postmaster at example.net mailadmin at example.net
[main.cf]
> virtual_mailbox_domains = domain.tld, domain1.tld
> virtual_mailbox_base = /var/vmail
> virtual_minimum_uid = 100
> virtual_uid_maps = static:5000
> virtual_gid_maps = static:5000
> virtual_alias_maps = hash:/etc/postfix/virtual
> virtual_transport = lmtp:unix:private/dovecot-lmtp
> […]
> smtpd_sender_login_maps=hash:/etc/postfix/virtual
>
One thing I need to watch out for, and am concerned with because the last
time I used Postfix there were a bunch of "virtual" configurations that
really didn't work for me for a reason I cannot recall right now ... is that
the same user name in different domains is NOT always the same user. E.g.
bob at example.com is NOT the same person as bob at example.net while
bob at example.org doesn't even exist. So there needs to be distinct entries
for bob at example.com and bob at example.net (and not any for bob at example.org and
have Postfix reject that during incoming SMTP sessions).
There can also be cases where mike at example.com and mike at example.net are the
same person, and Mike wants to have mail to these two addresses kept in
separate mail boxes (and presumably must do separate logins, so he'd have to
set up 2 accounts in his MUA) ... as well as steve at example.com and
steve at example.net also being the same person, but Steve wants everything in
one mailbox (so he'd have to pick between steve at example.com and
steve at example.net and I'd have to set up a virtual map for the other to be
delivered to the mailbox of his choice ... in a separate lookup table in
Postfix).
If this seems suitable I can send more details to you.
>
It might well be as long the domains are fully distinct. I'll have to go
read up on each of the virtual_* configuration parameters to be sure of the
effects. I was thinking to use:
mailbox_command = /usr/lib/dovecot/deliver
in Postfix main.cf. Is that workable instead of "virtual_transport =
lmtp:unix:private/dovecot-lmtp" Or would running LMTP be a better way?
More information about the dovecot
mailing list