Exim Move all messages without PTR to Spam
Exim:
acl_check_rcpt:
...
warn
!senders = :
condition = ${if eq{$sender_host_name}{}{yes}{no}}
logwrite = Host name not found for your IP address. Added header SPAM-MOVETOJUNK
add_header = SPAM-MOVETOJUNK: Host name not found for your IP address
Sieve:
# create folder
mkdir /etc/dovecot/sieve/
# /etc/dovecot/sieve/before.sieve
require ["fileinto"];
if exists "SPAM-MOVETOJUNK" {
fileinto "Junk";
stop;
}
Dovecot:
/etc/dovecot/conf.d/15-mailboxes.conf
namespace inbox {
...
mailbox Junk {
special_use = \Junk
auto = create
}
Troubleshooting
Error:
Error: sieve: binary save: failed to create temporary file: open(/etc/dovecot/sieve/before.svbin.domain.com.26932.) failed: Permission d...by 0:0 mode=0755)
Error: sieve: the lda sieve plugin does not have permission to save global sieve script binaries; global sieve scripts like /etc/dovecot/sieve/b...g the sievec tool
fix: