L
L
Lanccc2016-09-06 14:57:11
Debian
Lanccc, 2016-09-06 14:57:11

How to move spam emails after spamassassin evaluation to a specific mailbox?

Good afternoon, actually I have a bunch of debian + exim + spamassassin, inside the exchange 2010 office
I set up the first one about 2 months ago and it worked quite well until users began to complain that letters were not reaching, the culprit was quickly found in the form of black dns sheets rbl.rbldns .ru of course it cuts spam Pts. well, but it hurts a lot of letters and does not reach, and you are tormented and wrong to add exceptions, turned off spam, but marked spam, i.e. spamassassin filters it quite well, but the question arose how to make it so that all these letters with a rating of more than 5, let's say, fall into a certain mailbox, for example [email protected], and do not reach users?
As I understand it, spamassassin makes assessments and puts a heading in the subject of the letter if he didn’t like it, but he is not responsible for forwarding, so you need to write something in the exim config so that such letters are picked up and sent to the mailbox

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Zabelin, 2016-09-06
@stecker

Use the transport rule to catch letters and put them where you need

L
Lanccc, 2016-09-16
@Lanccc

if anyone needs to
#Specify the address to which to forward messages
#identified as spam, in case this is an error.
warn message = X-Redirect-To: [email protected]
hosts = !+relay_from_hosts
spam = nobody #Write spam
scores in headers
warn spam = nobody:true
hosts = !+relay_from_hosts
message = X-Spam-Level: $spam_bar
#Write spamassassin report headers
warn spam = nobody:true
hosts = !+relay_from_hosts
condition = ${if >{$spam_score_int}{29}{1}{0}}
message = X-Spam-Status: $spam_report
# if the letter scored more than 10 points, then we do not accept it - set deny
# to send to [email protected] - set accept
accept message = Message scored $spam_score spam points
spam = nobody:true
condition = ${if >{$spam_score_int}{100}{yes}{no}}
# and log
message logwrite = Email from $sender_address with $spam_score spam points redirected to [email protected] by SpamAssassin
# router forwarding spam to [email protected] mailbox
scan_redirect:
driver = redirect
condition = ${if def:h_X-Redirect -To: {1}{0}}
headers_add = X-Original-Recipient: [email protected]$domain
data = $h_X-Redirect-To:
headers_remove = X-Redirect-To

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question