How would I set up Dovecot and Postfix to use a different user database than passwd for the email accounts? I'd would like to have separate accounts for user, who can actually log in via ssh, and user who have a mail address, although those might be the same person.
Lets say I have a account A, who can connect to the server via ssh. Now I want to have an [email protected] mail address, but with a different password than the A account for ssh. The emails should nonetheless being saved in A's home folder.
How can this be accomplished?
Until now I have a directory structure defined in /etc/skel so that each ssh Account will have the mail directory automatically included. Then I set up the mail addresses via Postfix within the virtual file and then running 'postmap'.
Postfix calls these types of accounts Virtual Domains. Dovecot calls them Virtual Users. Virtual domains (and users) are not tied to system accounts.
Postfix can store the virtual domain information in local look-up files or LDAP. Dovecot requires an SQL or LDAP database.
LDAP is a common choice for storing virtual user information because of it's level of support among email software and its fast look up times.
Searching for "postfix dovecot ldap" turns up pages and pages of how-to and tutorial links that will get you started.
The term of art is "virtual hosting". Here's a guide on how to do this on CentOS:
https://sites.google.com/site/ghidit/how-to-2/centos-mail-server-setup-postfix-dovecot-mysql-virtual-users-sasl-postfixadmin-tls
So, the email account info would be stored in MySQL, in that example. It can also be stored in LDAP, sasldb, etc., depending on what you want to do to.