From 904b1a448d2a6b46def4e7c2d451140de66864a2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Thu, 12 Sep 2024 00:36:59 -0400 Subject: [PATCH] * Wed Sep 11 2024 Jean-Philippe Pialasse 11.0.0-9.sme - merge dovecot-extra [SME: 12735] - add sieves support over ssl and improve template --- .../db/configuration/defaults/sieve/access | 2 +- .../db/configuration/defaults/sieve/type | 2 +- .../db/configuration/defaults/sieves/TCPPort | 1 + .../db/configuration/defaults/sieves/access | 1 + .../defaults/sieves/sieve/TCPPort | 1 + .../defaults/sieves/sieve/access | 1 + .../defaults/sieves/sieve/status | 1 + .../configuration/defaults/sieves/sieve/type | 1 + .../db/configuration/defaults/sieves/status | 1 + .../db/configuration/defaults/sieves/type | 1 + .../dovecot/dovecot.conf/30listener11sieve | 57 +++++++++++++++++-- smeserver-dovecot.spec | 5 +- 12 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 root/etc/e-smith/db/configuration/defaults/sieves/TCPPort create mode 100644 root/etc/e-smith/db/configuration/defaults/sieves/access create mode 100644 root/etc/e-smith/db/configuration/defaults/sieves/sieve/TCPPort create mode 100644 root/etc/e-smith/db/configuration/defaults/sieves/sieve/access create mode 100644 root/etc/e-smith/db/configuration/defaults/sieves/sieve/status create mode 100644 root/etc/e-smith/db/configuration/defaults/sieves/sieve/type create mode 100644 root/etc/e-smith/db/configuration/defaults/sieves/status create mode 100644 root/etc/e-smith/db/configuration/defaults/sieves/type diff --git a/root/etc/e-smith/db/configuration/defaults/sieve/access b/root/etc/e-smith/db/configuration/defaults/sieve/access index 3e18ebf..2fbb50c 100644 --- a/root/etc/e-smith/db/configuration/defaults/sieve/access +++ b/root/etc/e-smith/db/configuration/defaults/sieve/access @@ -1 +1 @@ -private +localhost diff --git a/root/etc/e-smith/db/configuration/defaults/sieve/type b/root/etc/e-smith/db/configuration/defaults/sieve/type index 24e1098..f92f363 100644 --- a/root/etc/e-smith/db/configuration/defaults/sieve/type +++ b/root/etc/e-smith/db/configuration/defaults/sieve/type @@ -1 +1 @@ -service +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/sieves/TCPPort b/root/etc/e-smith/db/configuration/defaults/sieves/TCPPort new file mode 100644 index 0000000..6258b24 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/sieves/TCPPort @@ -0,0 +1 @@ +5190 diff --git a/root/etc/e-smith/db/configuration/defaults/sieves/access b/root/etc/e-smith/db/configuration/defaults/sieves/access new file mode 100644 index 0000000..3e18ebf --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/sieves/access @@ -0,0 +1 @@ +private diff --git a/root/etc/e-smith/db/configuration/defaults/sieves/sieve/TCPPort b/root/etc/e-smith/db/configuration/defaults/sieves/sieve/TCPPort new file mode 100644 index 0000000..025479c --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/sieves/sieve/TCPPort @@ -0,0 +1 @@ +4190 diff --git a/root/etc/e-smith/db/configuration/defaults/sieves/sieve/access b/root/etc/e-smith/db/configuration/defaults/sieves/sieve/access new file mode 100644 index 0000000..3e18ebf --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/sieves/sieve/access @@ -0,0 +1 @@ +private diff --git a/root/etc/e-smith/db/configuration/defaults/sieves/sieve/status b/root/etc/e-smith/db/configuration/defaults/sieves/sieve/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/sieves/sieve/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/sieves/sieve/type b/root/etc/e-smith/db/configuration/defaults/sieves/sieve/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/sieves/sieve/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/db/configuration/defaults/sieves/status b/root/etc/e-smith/db/configuration/defaults/sieves/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/sieves/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/sieves/type b/root/etc/e-smith/db/configuration/defaults/sieves/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/sieves/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/30listener11sieve b/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/30listener11sieve index 42c8e8a..98ac3ef 100644 --- a/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/30listener11sieve +++ b/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/30listener11sieve @@ -1,17 +1,64 @@ { -if (($sieve{'status'} || 'enabled') eq 'enabled'){ - my $port = $sieve{'TCPPort'} || '4190'; - my $address = $sieve{'Listen'} || '127.0.0.1'; - $OUT .=<<"HERE"; +my $sieveStatus = $sieve{'status'} || 'enabled'; +my $sievesStatus = $sieves{'status'} || 'enabled'; +my $port = $sieve{'TCPPort'} || '4190'; +# should we only allow localhost ? +my $sieveAccess = $sieve{'access'} || 'localhost'; +my $sieveListen = $sieve{'Listen'} || ''; +my $sieveAddress = ""; +if ($sieveAccess eq 'localhost') { + $sieveAddress = '127.0.0.1'; + } elsif ($sieveAccess eq 'private') { + $sieveAddress = "127.0.0.1 $LOCALIP"; + } elsif ($sieveAccess eq 'public') { + $sieveAddress = "127.0.0.1 $LOCALIP $EXTERNALIP"; + } +$sieveAddress .= " $sieveListen"; +my $ports = $sieves{'TCPPort'} || '5190'; +my $sievesAccess = $sieves{'access'} || 'localhost'; +my $sievesListen = $sieves{'Listen'} || ''; +my $sievesAddress = ""; +if ($sievesAccess eq 'localhost') { + $sievesAddress = '127.0.0.1'; + } elsif ($sievesAccess eq 'private') { + $sievesAddress = "127.0.0.1 $LOCALIP"; + } elsif ($sievesAccess eq 'public') { + $sievesAddress = "127.0.0.1 $LOCALIP $EXTERNALIP"; + } +$sievesAddress .= " $sievesListen"; + + +if ( $sieveStatus eq 'enabled' || $sievesStatus eq 'enabled') { + $OUT .=<<"HERE"; service managesieve-login { + +HERE + + if ( $sieveStatus eq 'enabled' ) { + $OUT .=<<"HERE"; inet_listener sieve { port = $port - address = $address + address = $sieveaddress } +HERE +} + + if ( $sievesStatus eq 'enabled' ) { + $OUT .=<<"HERE"; + inet_listener sieves { + port = $ports + ssl = yes + address = $sievesaddress + } +HERE +} + + $OUT .=<<"HERE"; } HERE + } else { $OUT .= "# Sieve is disabled"; diff --git a/smeserver-dovecot.spec b/smeserver-dovecot.spec index 4622711..50568aa 100644 --- a/smeserver-dovecot.spec +++ b/smeserver-dovecot.spec @@ -1,5 +1,5 @@ %define version 11.0.0 -%define release 8 +%define release 9 %define name smeserver-dovecot @@ -40,8 +40,9 @@ Configure the dovecot IMAP server with sieve scripts support, quota, ACL, extended logging, master user %changelog -* Wed Sep 11 2024 Jean-Philippe Pialasse 11.0.0-8.sme +* Wed Sep 11 2024 Jean-Philippe Pialasse 11.0.0-9.sme - merge dovecot-extra [SME: 12735] +- add sieves support over ssl and improve template * Fri Apr 05 2024 Jean-Philippe Pialasse 11.0.0-7.sme - add missing requirement for portreserve [SME: 12589]