* Wed Sep 11 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-8.sme
- merge dovecot-extra [SME: 12735]
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
{
|
||||
if (($sieve{'status'} || 'disabled') eq 'enabled'){
|
||||
$proto .= " sieve";
|
||||
}
|
||||
$OUT .= "";
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
{
|
||||
if (($sieve{'status'} || 'enabled') eq 'enabled'){
|
||||
my $port = $sieve{'TCPPort'} || '4190';
|
||||
my $address = $sieve{'Listen'} || '127.0.0.1';
|
||||
$OUT .=<<"HERE";
|
||||
|
||||
service managesieve-login {
|
||||
inet_listener sieve {
|
||||
port = $port
|
||||
address = $address
|
||||
}
|
||||
}
|
||||
|
||||
HERE
|
||||
}
|
||||
else {
|
||||
$OUT .= "# Sieve is disabled";
|
||||
}
|
||||
}
|
@@ -0,0 +1,89 @@
|
||||
{
|
||||
return "# Mailbox sharing is not enabled"
|
||||
if (($dovecot{'SharedMailbox'} || 'disabled') eq 'disabled') && (($dovecot{'PublicMailbox'} || 'disabled') eq 'disabled');
|
||||
|
||||
push @plugins, 'acl';
|
||||
push @imap_plugins, 'imap_acl';
|
||||
|
||||
my $common =<<'_EOF';
|
||||
|
||||
mail_access_groups = sharedmailbox
|
||||
|
||||
service dict {
|
||||
unix_listener dict {
|
||||
mode = 0660
|
||||
group = sharedmailbox
|
||||
}
|
||||
}
|
||||
|
||||
service auth {
|
||||
unix_listener auth-userdb {
|
||||
mode = 0660
|
||||
group = sharedmailbox
|
||||
}
|
||||
}
|
||||
|
||||
service imap {
|
||||
executable = imap imap-postlogin
|
||||
}
|
||||
|
||||
service imap-postlogin {
|
||||
executable = script-login -d /usr/bin/imap-postlogin
|
||||
unix_listener imap-postlogin {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
type = private
|
||||
separator = /
|
||||
prefix =
|
||||
inbox = yes
|
||||
}
|
||||
_EOF
|
||||
|
||||
my $shared_mb = "\n# SharedMailbox is disabled\n";
|
||||
my $public_mb = "\n# PublicMailbox is disabled\n";
|
||||
if (($dovecot{'SharedMailbox'} || 'disabled') eq 'enabled'){
|
||||
$shared_mb =<<'_EOF';
|
||||
namespace {
|
||||
type = shared
|
||||
separator = /
|
||||
prefix = shared/%%u/
|
||||
location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u
|
||||
subscriptions = no
|
||||
list = children
|
||||
}
|
||||
_EOF
|
||||
}
|
||||
if (($dovecot{'PublicMailbox'} || 'disabled') eq 'enabled'){
|
||||
$public_mb =<<'_EOF';
|
||||
namespace {
|
||||
type = public
|
||||
separator = /
|
||||
prefix = public/
|
||||
location = maildir:/home/e-smith/files/public
|
||||
subscriptions = no
|
||||
list = children
|
||||
}
|
||||
_EOF
|
||||
}
|
||||
|
||||
my $acl =<<'_EOF';
|
||||
plugin {
|
||||
acl_shared_dict = file:/home/e-smith/db/dovecot/sharedmailbox.db
|
||||
}
|
||||
|
||||
plugin {
|
||||
acl = vfile
|
||||
}
|
||||
|
||||
plugin {
|
||||
acl_anyone = allow
|
||||
}
|
||||
|
||||
_EOF
|
||||
|
||||
push @conf, $common, $shared_mb, $public_mb, $acl;
|
||||
$OUT .= '';
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
{
|
||||
# If we have imap_sieve plugin, enable it
|
||||
if (( -e '/usr/lib64/dovecot/lib95_imap_sieve_plugin.so' || -e '/usr/lib/dovecot/lib95_imap_sieve_plugin.so') &&
|
||||
($spamassassin{'UseBayes'} || 'disabled') =~ m/^1|on|yes|enabled$/){
|
||||
push @imap_plugins, 'imap_sieve';
|
||||
my $index = 1;
|
||||
$OUT.= <<'_EOF';
|
||||
|
||||
plugin {
|
||||
sieve_plugins = sieve_imapsieve sieve_extprograms
|
||||
sieve_execute_bin_dir = /usr/libexec/dovecot
|
||||
sieve_pipe_bin_dir = /usr/libexec/dovecot
|
||||
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute
|
||||
|
||||
_EOF
|
||||
|
||||
if (($dovecot{'LearnSpam'} || 'enabled') =~ m/^1|on|yes|enabled$/){
|
||||
$OUT.= <<"_EOF";
|
||||
# Copy from anywhere to junkmail
|
||||
imapsieve_mailbox$index\_name = junkmail
|
||||
imapsieve_mailbox$index\_causes = COPY
|
||||
imapsieve_mailbox$index\_before = file:/usr/libexec/dovecot/sieve/report-spam.sieve
|
||||
_EOF
|
||||
$index++;
|
||||
$OUT.= <<"_EOF";
|
||||
imapsieve_mailbox$index\_name = Junk
|
||||
imapsieve_mailbox$index\_causes = COPY
|
||||
imapsieve_mailbox$index\_before = file:/usr/libexec/dovecot/sieve/report-spam.sieve
|
||||
_EOF
|
||||
$index++;
|
||||
}
|
||||
if (($dovecot{'LearnHam'} || 'enabled') =~ m/^1|on|yes|enabled$/){
|
||||
$OUT.= <<"_EOF";
|
||||
# Copy from junkmail to anywhere
|
||||
imapsieve_mailbox$index\_name = *
|
||||
imapsieve_mailbox$index\_from = junkmail
|
||||
imapsieve_mailbox$index\_causes = COPY
|
||||
imapsieve_mailbox$index\_before = file:/usr/libexec/dovecot/sieve/report-ham.sieve
|
||||
_EOF
|
||||
$index++;
|
||||
$OUT.= <<"_EOF";
|
||||
imapsieve_mailbox$index\_name = *
|
||||
imapsieve_mailbox$index\_from = Junk
|
||||
imapsieve_mailbox$index\_causes = COPY
|
||||
imapsieve_mailbox$index\_before = file:/usr/libexec/dovecot/sieve/report-ham.sieve
|
||||
_EOF
|
||||
$index++;
|
||||
}
|
||||
|
||||
$OUT .= '}';
|
||||
}
|
||||
}
|
19
root/etc/e-smith/templates/etc/dovecot/dovecot.conf/91lda
Normal file
19
root/etc/e-smith/templates/etc/dovecot/dovecot.conf/91lda
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
postmaster_address = postmaster@{$DomainName}
|
||||
lda_original_recipient_header = to
|
||||
|
||||
{
|
||||
my $reason = $dovecot{'RejectMessage'} || '';
|
||||
my $subject = $dovecot{'RejectSubject'} || '';
|
||||
if ($reason ne ''){
|
||||
$OUT .= "rejection_reason = $reason\n";
|
||||
}
|
||||
if ($subject ne ''){
|
||||
$OUT .= "rejection_subject = $subject\n";
|
||||
}
|
||||
}
|
||||
|
||||
protocol lda \{
|
||||
mail_plugins = $mail_plugins {$OUT .= (($sieve{'status'} || 'disabled') eq 'enabled') ? 'sieve':''}
|
||||
\}
|
||||
|
@@ -0,0 +1,11 @@
|
||||
{
|
||||
|
||||
if (($dovecot{'PublicMailbox'} || 'disabled') eq 'enabled'){
|
||||
my @PublicMailboxAdmins = split /[,:]/, ($dovecot{PublicMailboxAdmins} || '');
|
||||
$OUT .= "user=admin lrswtipekxa" . "\n";
|
||||
foreach my $PublicMailboxAdmins (sort @PublicMailboxAdmins){
|
||||
$OUT .= 'user=' . "$PublicMailboxAdmins " . 'lrswtipekxa' . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user