You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.6 KiB
52 lines
1.6 KiB
{
|
|
# 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 .= '}';
|
|
}
|
|
}
|
|
|