Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ Available states
------------

Installs and configures the dovecot package, and ensures that the associated dovecot service is running.

``dovecot.dh``
--------------

Creates Diffie-Hellman Parameters at the path defined in Pillar `dovecot:ssl:dhparam:path`.
8 changes: 8 additions & 0 deletions dovecot/dh.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{%- from "dovecot/map.jinja" import dovecot with context %}

dovecot-dh-create-dhparam-file:
cmd.run:
- name: "openssl dhparam {{ dovecot.ssl.dhparam.numbits }} > {{ dovecot.ssl.dhparam.path }}"
- creates: {{ dovecot.ssl.dhparam.path }}
- watch_in:
- service: dovecot_service
12 changes: 12 additions & 0 deletions dovecot/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
'ssl_certs_dir': '/usr/local/etc/ssl/certs',
'ssl_keys_dir': '/usr/local/etc/ssl/private',
},
'ssl': {
'dhparam': {
'path': '/usr/local/etc/dovecot/dh.pem',
'numbits': 2048
}
},
'packages': ['dovecot'],
'root_group': 'wheel',
},
Expand All @@ -93,6 +99,12 @@
'ssl_certs_dir': '/etc/ssl/private',
'ssl_keys_dir': '/etc/ssl/private',
},
'ssl': {
'dhparam': {
'path': '/etc/dovecot/dh.pem',
'numbits': 2048
}
},
'packages': ['dovecot-core','dovecot-imapd'],
'root_group': 'root',
},
Expand Down
4 changes: 4 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ dovecot:
lookup:
enable_service_control: True
service_persistent: True
ssl:
dhparam:
path: /etc/dovecot/dh.pem
numbits: 2048
config:
local: |
# main
Expand Down