only put smtp server without rdns or frcdns to spam folder instead of drop connection

This commit is contained in:
Chang, Chu-Kuan 2021-05-06 14:30:25 +08:00
parent 7820fc86f6
commit 3f7ec821ff
1 changed files with 5 additions and 4 deletions

View File

@ -134,8 +134,8 @@ smtp max-message-size 100M
pki "${maildomain}" cert "${certfile}" pki "${maildomain}" cert "${certfile}"
pki "${maildomain}" key "${keyfile}" pki "${maildomain}" key "${keyfile}"
filter "check_rdns" phase connect match !rdns disconnect "550 no rDNS" filter "check_rdns" phase connect match !rdns junk
filter "check_fcrdns" phase connect match !fcrdns disconnect "550 no FCrDNS" filter "check_fcrdns" phase connect match !fcrdns junk
filter "rspamd" proc-exec "filter-rspamd" filter "rspamd" proc-exec "filter-rspamd"
filter "spam_triad" chain { "check_rdns", "check_fcrdns", "rspamd" } filter "spam_triad" chain { "check_rdns", "check_fcrdns", "rspamd" }
@ -305,8 +305,9 @@ mkdir -p /usr/local/lib/dovecot/sieve/
# Default sieve script: put Rspamd-tagged mails into mailbox "Spam" # Default sieve script: put Rspamd-tagged mails into mailbox "Spam"
cat << EOF > /usr/local/lib/dovecot/sieve/default.sieve cat << EOF > /usr/local/lib/dovecot/sieve/default.sieve
require "fileinto"; require "fileinto";
if header :contains "X-Spam" "YES" { require "mailbox";
fileinto "Spam"; if header :contains "X-Spam" ["YES", "yes"] {
fileinto :create "Spam";
} }
EOF EOF