AW: AW: sieve filter bevor.spam, arnt take effect

mauric at gmx.ch mauric at gmx.ch
Mon Apr 12 23:07:55 EEST 2021


>Hi again,
>Your dovecot.conf neither contains the sieve settings nor includes the
conf.d/90-sieve.conf file, which means that you only get whatever >default
config dovecot includes.
>Good luck..


Now i put everyting that I "need" for forward spam to folder Junk-E-Mail.tje
the goal are that the spam email that will deliver direct to Junk-E-Mail
folder.

root at nmail:/etc/dovecot# cat dovecot.conf
# 2.2.27 (c0f36b0): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.16 (fed8554)
# OS: Linux 4.9.0-12-amd64 x86_64 Debian 9.12
# Enable installed protocols
!include_try /usr/share/dovecot/protocols.d/*.protocol
auth_mechanisms = plain login
auth_verbose = yes
disable_plaintext_auth = yes
info_log_path = /var/log/mail.log
log_timestamp = %b %d %H:%M:%S Dovecot/
mail_access_groups = vmail
mail_location = maildir:~/Maildir
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags
copy include variables body enotify environment mailbox date ihave

namespace inbox {
   inbox = yes
   location =
   mailbox Drafts {
    special_use = \Drafts
 }
   mailbox Junk-E-Mail {
    special_use = \Junk
 }
   mailbox Sent {
    special_use = \Sent
 }
   mailbox "Sent Messages" {
    special_use = \Sent
 }
   mailbox Trash {
    special_use = \Trash
 }
  prefix =
 }

passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}

protocols = imap lmtp sieve

service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
  unix_listener auth-client {
    mode = 0660
    user = mail
  }
}
service imap-login {
  inet_listener imap {
    port = 0
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
}

service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    mode = 0600
    user = postfix
    group = postfix
  }
}

postmaster_address = mca at caloro.ch

protocol lda {
  # Space separated list of plugins to load (default is global
mail_plugins).
  mail_plugins = $mail_plugins quota sieve
}


ssl = required
ssl_key = </etc/letsencrypt/live/domain/privkey.pem
ssl_cert = </etc/letsencrypt/live/domain/fullchain.pem

ssl_dh=</etc/dovecot/dh.pem

ssl_min_protocol=TLSv1.2
ssl_cipher_list = ECDHE-RSA-CHACHA20-POLY1305:ALL:!LOW:!SSLv2:!EXP:!aNULL

userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}

protocol imap {
        ssl_key = </etc/letsencrypt/live/domain/privkey.pem
        ssl_cert = </etc/letsencrypt/live/domain/fullchain.pem
        mail_plugins = " quota imap_quota"
}
protocol lmtp {
  # Space separated list of plugins to load (default is global
mail_plugins).
  mail_plugins = $mail_plugins sieve
}

plugin {
  # The path to the user's main active script. If ManageSieve is used, this
the
  # location of the symbolic link controlled by ManageSieve.

        sieve = file:%h/sieve;active=%h/.dovecot.sieve
        sieve_before = /etc/dovecot/sieve/before.sieve
}

service stats {
  unix_listener stats-reader {
    group = vmail
    mode = 0666
    user = vmail
  }
  unix_listener stats-writer {
    group = vmail
    mode = 0666
    user = vmail
  }
}



--
Cat /etc/dovecot/sieve/before.sieve

	require "fileinto";
	  if exists "X-Spam-Flag" {
          		if header :contains "X-Spam-Flag" "YES" {
	          } 	else	{
          fileinto "Junk E-Mail";
          stop;
          }
  }



More information about the dovecot mailing list