I'm having trouble understanding how Postfix relays data to Dovecot and looking for a minimal (as little deviation from distro config files as possible) but complete example on how to accomplish the following:
I have several domains for which I want to receive mail. I want to have virtual users with all information about them, including passwords stored in plain-text file(s).
So, following Postfix's example I would have
virtual_mailbox_domains = mydomain1.com, mydomain2.com, ... (or a hash)
virtual_mailbox_maps = hash:/path/to/vmailboxes
virtual_transport = lmtp:unix:private/dovecot-lmtp
and in vmailboxes I would have
[email protected] someuser
and in Dovecot I would have
passdb {
driver = passwd-file
args = scheme=plain-md5 username_format=%n /usr/local/etc/dovecot/users
}
userdb {
driver = passwd-file
args = username_format=%n /usr/local/etc/dovecot/users
default_fields = uid=dovecot gid=dovecot home=/home/dovecot/%u
}
So the way I see it I should have Postfix accept mail for [email protected], understand that it's destined for the user named someuser and relay precisely that to Dovecot. However Postfix always relays [email protected] to Dovecot which is definitely not what I want because I may have other email addresses pointing to the same user, say
[email protected] someuser
[email protected] someuser
and I expect Dovecot to consult its password/user database and stuff the mail in the appropriate directory for someuser. I also likewise expect it to consult the very same database for IMAP authentication.
And finally, I would like to have SMTP authorization so that someuser may connect to Postfix and use it as a relay. How would I do that with the configuration that I have? Should I have separate password tables in Postfix just for that, or will Postfix somehow consult Dovecot and allow said user to send mail?