From 516ed2041f3ff0d893ed116b11179e4c7ae2ad09 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 14 Apr 2021 19:32:14 -0300 Subject: Fix debian bug 903161 --- manifests/dovecot.pp | 12 ++++++++++-- manifests/virtual.pp | 4 ++++ templates/dovecot/dovecot.conf.buster.erb | 23 +++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/manifests/dovecot.pp b/manifests/dovecot.pp index d76ae79..f0ab0dd 100644 --- a/manifests/dovecot.pp +++ b/manifests/dovecot.pp @@ -1,9 +1,17 @@ class mail::dovecot { + group { 'dovecot': + ensure => present, + } + + user { 'dovecot': + ensure => present, + gid => 'dovecot', + require => Group['dovecot'], + } - # Dovecot service { "dovecot": ensure => running, - require => [ Package['dovecot-imapd'], File['/etc/dovecot/dovecot.conf', '/etc/dovecot/dovecot-sql.conf'] ], + require => [ Package['dovecot-imapd'], File['/etc/dovecot/dovecot.conf', '/etc/dovecot/dovecot-sql.conf'], User['dovecot'], ], } file { "/etc/dovecot/dovecot.conf": diff --git a/manifests/virtual.pp b/manifests/virtual.pp index df2f364..c548ba1 100644 --- a/manifests/virtual.pp +++ b/manifests/virtual.pp @@ -31,12 +31,16 @@ class mail::virtual( gid => 5000, } + # The vmail user maybe needs to be in the dovecot group to be able to use the stats-writer + # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903161 user { "vmail": ensure => present, uid => 5000, gid => "vmail", password => "*", home => '/var/mail/virtual', + #groups => [ 'dovecot', ], + #require => Group['vmail', 'dovecot'], require => Group['vmail'], } } diff --git a/templates/dovecot/dovecot.conf.buster.erb b/templates/dovecot/dovecot.conf.buster.erb index 94c4f09..a515e35 100644 --- a/templates/dovecot/dovecot.conf.buster.erb +++ b/templates/dovecot/dovecot.conf.buster.erb @@ -73,3 +73,26 @@ protocol lda { # Should saving a mail to a non-existing mailbox automatically create it? lda_mailbox_autocreate = yes + +# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903161 +service stats { + unix_listener stats-reader { + mode = 0 + } + unix_listener stats-writer { + mode = 0 + } +} + +# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903161 +service old-stats { + fifo_listener old-stats-mail { + mode = 0 + } + fifo_listener old-stats-user { + mode = 0 + } + unix_listener old-stats { + mode = 0 + } +} -- cgit v1.2.3