7

I'm using postfix and dovecot.

I want to send and receive email from root.

Until I use SSL/TLS certificate, I am using an unencrypted connection.

Since my email password is the same as my ssh password, someone could easily sniff the traffic and login as root.

How do I change my dovecot password to make it different than the linux user password?

1
  • 2
    The absolute #1 first step in setting up any Linux server should be to disable password authentication via SSH. Set up key auth posthaste. Seriously - doing this should be a much higher priority than working out this dovecot issue.
    – EEAA
    Oct 31, 2015 at 19:51

2 Answers 2

9

Dovecot conceptually separates user account information into two databases:

You can have multiple databases of each type, and Dovecot will use the first one with a matching entry. There are several database backends, and you can choose different backends for the user and password databases. For example, you could use SQL for the user database and a flat passwd-like file for the password database.

In your case, it sounds like you want to configure Dovecot to use all of the normal system user information except for the password. This is a pretty common situation, as described in the System Users wiki page:

Admins often wish to use different passwords for IMAP and POP3 than for other services (eg. SSH), because IMAP and POP3 clients often send the password unencrypted over the internet without even bothering to give users any warnings. Dovecot can easily support non-system passwords for system users.

[...]

If you wish to use non-system passwords, you can use pretty much any of the Dovecot's password databases, but for simple installations you'll probably want to use passwd-file.

User database for system users is always passwd.

Here's a concrete example of how you would set it up. In your /etc/dovecot/dovecot.conf you would put something like this:

passdb {
  driver = passwd-file
  args = /etc/dovecot/passwd
}
userdb {
  driver = passwd
}

and your /etc/dovecot/passwd file would contain a line like this:

root:{CRYPT}zVQDPzjspy126

The above configuration tells Dovecot to look in /etc/dovecot/passwd for password information (and only root is present so only that user would be able to log in) and look in the system user database for everything else.

See this answer for how to generate the encrypted password field in your /etc/dovecot/passwd file.

1
1

You want so called virtual users - some separate accounts that are not interfere with system ones. There is lot of backends possible - plain files, SQL servers, LDAP and so on. The only suggestion - use dovecot-auth within postfix to deal with single authorization backend.

2
  • Can virtual users and system users have the same username?
    – User
    Nov 1, 2015 at 21:55
  • Yes but you have to be sure your MTA process virtual accounts instead/before system ones.
    – Kondybas
    Nov 3, 2015 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .