]> birchwood-abbey.net Git - Institute/commitdiff
Accommodate changes to Dovecot's configuration language in v2.4.
authorMatt Birkholz <matt@birchwood-abbey.net>
Mon, 22 Dec 2025 15:41:17 +0000 (08:41 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Mon, 22 Dec 2025 15:41:17 +0000 (08:41 -0700)
~ssl_cerl~ and ~ssl_key~ were renamed and ~mail_location~ was split in
two.

README.org
roles_t/core/tasks/main.yml
roles_t/front/tasks/main.yml

index 68a145bcf43a438a5f082f69d0c292d3a484fe7a..585359d9edad030b82a5784a1870392b9c843e22 100644 (file)
@@ -282,15 +282,25 @@ service imap-login {
 Both Dovecot servers store member email in members' local =~/Maildir/=
 directories.
 
-#+NAME: dovecot-maildir
+#+NAME: dovecot-2.3-maildir
 #+CAPTION: ~dovecot-maildir~
 #+BEGIN_SRC conf
 mail_location = maildir:~/Maildir
 #+END_SRC
 
+In version 2.4 (Debian 13), this variable was split in two.
+
+#+NAME: dovecot-maildir
+#+CAPTION: ~dovecot-maildir~
+#+BEGIN_SRC conf
+mail_driver = maildir
+mail_path = ~/Maildir
+#+END_SRC
+
 The complete Dovecot configurations for Front and Core use these
-common settings with host specific settings for ~ssl_cert~ and
-~ssl_key~.
+common settings with host specific settings for ~ssl_server_cert_file~
+and ~ssl_server_key_file~, ~ssl_cert~ and ~ssl_key~ on versions of
+Dovecot before 2.4 (Debian 13).
 
 ** The Web Services
 
@@ -1752,7 +1762,7 @@ and enables it to start at every reboot.
   become: yes
   apt: pkg=dovecot-imapd
 
-- name: Configure Dovecot IMAPd.
+- name: Configure Dovecot 2.3 IMAPd.
   become: yes
   copy:
     content: |
@@ -1760,8 +1770,26 @@ and enables it to start at every reboot.
       ssl_cert = </etc/server.crt
       ssl_key = </etc/server.key
       <<dovecot-ports>>
+      <<dovecot-2.3-maildir>>
+    dest: /etc/dovecot/local.conf
+  when: ansible_distribution != 'Debian'
+        or ( ansible_distribution == 'Debian'
+             and 13 > ansible_distribution_major_version|int )
+  notify: Restart Dovecot.
+
+- name: Configure Dovecot IMAPd.
+  become: yes
+  copy:
+    content: |
+      <<dovecot-tls>>
+      ssl_server_cert_file = /etc/server.crt
+      ssl_server_key_file = /etc/server.key
+      <<dovecot-ports>>
       <<dovecot-maildir>>
     dest: /etc/dovecot/local.conf
+  when:
+  - ansible_distribution == 'Debian'
+  - 12 < ansible_distribution_major_version|int
   notify: Restart Dovecot.
 
 - name: Start Dovecot.
@@ -3184,15 +3212,32 @@ and enables it to start at every reboot.
   become: yes
   apt: pkg=dovecot-imapd
 
-- name: Configure Dovecot IMAPd.
+- name: Configure Dovecot 2.3 IMAPd.
   become: yes
   copy:
     content: |
       <<dovecot-tls>>
       ssl_cert = </etc/server.crt
       ssl_key = </etc/server.key
+      <<dovecot-2.3-maildir>>
+    dest: /etc/dovecot/local.conf
+  when: ansible_distribution != 'Debian'
+        or ( ansible_distribution == 'Debian'
+             and 13 > ansible_distribution_major_version|int )
+  notify: Restart Dovecot.
+
+- name: Configure Dovecot IMAPd.
+  become: yes
+  copy:
+    content: |
+      <<dovecot-tls>>
+      ssl_server_cert_file = /etc/server.crt
+      ssl_server_key_file = /etc/server.key
       <<dovecot-maildir>>
     dest: /etc/dovecot/local.conf
+  when:
+  - ansible_distribution == 'Debian'
+  - 12 < ansible_distribution_major_version|int
   notify: Restart Dovecot.
 
 - name: Start Dovecot.
index bbc93e8133a367a9d29ebcd76dfe08e299677e15..75db29629cbd97b77901f5c95890b3c19dfeaec1 100644 (file)
   become: yes
   apt: pkg=dovecot-imapd
 
-- name: Configure Dovecot IMAPd.
+- name: Configure Dovecot 2.3 IMAPd.
   become: yes
   copy:
     content: |
       ssl_key = </etc/server.key
       mail_location = maildir:~/Maildir
     dest: /etc/dovecot/local.conf
+  when: ansible_distribution != 'Debian'
+        or ( ansible_distribution == 'Debian'
+             and 13 > ansible_distribution_major_version|int )
+  notify: Restart Dovecot.
+
+- name: Configure Dovecot IMAPd.
+  become: yes
+  copy:
+    content: |
+      protocols = imap
+      ssl = required
+      ssl_server_cert_file = /etc/server.crt
+      ssl_server_key_file = /etc/server.key
+      mail_driver = maildir
+      mail_path = ~/Maildir
+    dest: /etc/dovecot/local.conf
+  when:
+  - ansible_distribution == 'Debian'
+  - 12 < ansible_distribution_major_version|int
   notify: Restart Dovecot.
 
 - name: Start Dovecot.
index f3dd75ad60218dbae1717096f9bba52e0f5430cf..1256286cd57b128b5028385e35d521dbb6775f24 100644 (file)
   become: yes
   apt: pkg=dovecot-imapd
 
-- name: Configure Dovecot IMAPd.
+- name: Configure Dovecot 2.3 IMAPd.
   become: yes
   copy:
     content: |
       }
       mail_location = maildir:~/Maildir
     dest: /etc/dovecot/local.conf
+  when: ansible_distribution != 'Debian'
+        or ( ansible_distribution == 'Debian'
+             and 13 > ansible_distribution_major_version|int )
+  notify: Restart Dovecot.
+
+- name: Configure Dovecot IMAPd.
+  become: yes
+  copy:
+    content: |
+      protocols = imap
+      ssl = required
+      ssl_server_cert_file = /etc/server.crt
+      ssl_server_key_file = /etc/server.key
+      service imap-login {
+        inet_listener imap {
+          port = 0
+        }
+      }
+      mail_driver = maildir
+      mail_path = ~/Maildir
+    dest: /etc/dovecot/local.conf
+  when:
+  - ansible_distribution == 'Debian'
+  - 12 < ansible_distribution_major_version|int
   notify: Restart Dovecot.
 
 - name: Start Dovecot.