Single account file with email address as the username

This commit is contained in:
Jason Rothstein 2022-04-10 17:40:27 -05:00
parent 13ea9c20a6
commit e6f243b079
4 changed files with 12 additions and 1 deletions

View File

@ -16,6 +16,7 @@ Role Variables
| - | - | - |
| dovecot_vhost | inventory_hostname | What mod_md certificate should be used for Dovecot |
| dovecot_quota | 1G | Default mail quota for users of the system |
| dovecot_users | undefined | list of dictionary with the elements of email address and password (converted to CRYPT-SHA512) |
Dependencies
------------

View File

@ -0,0 +1,5 @@
{% if defined dovecot_users and dovecot_users is iterable %}
{% foreach user in dovecot_users %}
{{ user.email }}:{{ user.password | password_hash('sha512') }}::::::
{% endfor %}
{% %}

View File

@ -14,7 +14,7 @@ mail_home = /var/spool/mail/%d/%u
passdb {
driver = passwd-file
args = username_format=%n scheme=SHA512-CRYPT /etc/dovecot/accounts/%d/etc/passwd
args = username_format=%n scheme=SHA512-CRYPT /etc/dovecot/accounts
}
userdb {
driver = static

View File

@ -87,6 +87,11 @@ template_list:
src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/dovecot/dovecot.conf'
- dest: '/etc/dovecot/local.conf'
src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/dovecot/local.conf'
- dest: '/etc/dovecot/accounts'
group: 'dovecot'
mode: '0600'
owner: 'dovecot'
src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/dovecot/accounts'
- dest: '/usr/lib/systemd/system/dovecot-copytls.service'
src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/usr/lib/systemd/system/dovecot-copytls.service'
- dest: '/usr/lib/systemd/system/dovecot-copytls.timer'