diff --git a/dovecot/defaults/main.yml b/dovecot/defaults/main.yml
index b253b5b000199a992e9fb8527cc1b2f595bf7d23..24ac6b0277eb52be8a5321e21a562357dbcaba33 100644
--- a/dovecot/defaults/main.yml
+++ b/dovecot/defaults/main.yml
@@ -35,6 +35,10 @@ dovecot_sieve: 'file:~/sieve;active=~/.dovecot.sieve'
 
 # These variables were introduced for compatibility to a certain setup.
 # They may disappear without prior notice and/or may not work as expected.
+dovecot_process_limit: 100
+dovecot_client_limit: 1000
+dovecot_imap_idle_interval: '29 mins'
+dovecot_imap_max_userip_connections: 40
 dovecot_lda_mailbox_autocreate: false
 dovecot_lda_mailbox_autosubscribe: false
 dovecot_auth_realms: []
diff --git a/dovecot/templates/conf.d/10-master.conf.j2 b/dovecot/templates/conf.d/10-master.conf.j2
index 3aabeeb42891fcf8c87e8a50c0e730b5605c7c60..957da6b8ae2aaf941c67529f8cb243bd01501774 100644
--- a/dovecot/templates/conf.d/10-master.conf.j2
+++ b/dovecot/templates/conf.d/10-master.conf.j2
@@ -1,5 +1,5 @@
-#default_process_limit = 100
-#default_client_limit = 1000
+default_process_limit = {{ dovecot_process_limit }}
+default_client_limit = {{ dovecot_client_limit }}
 
 # Default VSZ (virtual memory size) limit for service processes. This is mainly
 # intended to catch and kill processes that leak memory before they eat up
@@ -99,7 +99,15 @@ service auth {
 #  user = $default_internal_user
    user = dovecot
    group = dovecot
+{% if dovecot_client_limit != 1000 %}
+  client_limit = {{ dovecot_client_limit * 2 }}
+{% endif %}
 }
+{% if dovecot_client_limit != 1000 %}
+service anvil {
+  client_limit = {{ dovecot_client_limit + 500 }}
+}
+{% endif %}
 
 service auth-worker {
   # Auth worker process is run as root by default, so that it can access
diff --git a/dovecot/templates/conf.d/20-imap.conf.j2 b/dovecot/templates/conf.d/20-imap.conf.j2
index a3ddfe4603f45e5bb665fc65ffacdf3f54259500..77cf9b45cf3439ea89fb259efe9808aff36e6058 100644
--- a/dovecot/templates/conf.d/20-imap.conf.j2
+++ b/dovecot/templates/conf.d/20-imap.conf.j2
@@ -39,8 +39,7 @@
 
 # How long to wait between "OK Still here" notifications when client is
 # IDLEing.
-#imap_idle_notify_interval = 2 mins
-imap_idle_notify_interval = 29 mins
+imap_idle_notify_interval = {{ dovecot_imap_idle_interval }}
 
 # ID field names and values to send to clients. Using * as the value makes
 # Dovecot use the default value. The following fields have default values
@@ -92,12 +91,11 @@ imap_idle_notify_interval = 29 mins
 
 protocol imap {
   # Space separated list of plugins to load (default is global mail_plugins).
-  #mail_plugins = $mail_plugins
+  mail_plugins = $mail_plugins
 
   # Maximum number of IMAP connections allowed for a user from each IP address.
   # NOTE: The username is compared case-sensitively.
-  #mail_max_userip_connections = 10
-  mail_max_userip_connections = 40
+  mail_max_userip_connections = {{ dovecot_imap_max_userip_connections }}
 }
 
 {% if dovecot_content_filter %}