A
A
Archiba2014-07-23 10:11:54
Exim
Archiba, 2014-07-23 10:11:54

How to configure the Exim system filter in conjunction with Spamassassin?

Good afternoon, the Exim SMTP server is running in conjunction with the Spamassassin (SA) anti-spam, which is running as a daemon. There is a task to change the heading of letters if SA has found out that the letter is spam. Decided to do through the system filter in Exim'e
configure

...
spamd_address = 127.0.0.1 783
system_filter = /usr/local/etc/exim/sa_exim
...

sa_exim
logfile /var/log/exim/mainlog

if "$message_headers" contain "X-Spam-Flag: Yes"
    then
        headers add "Old-Subject: $h_subject:"
        headers remove "Subject"
        headers add "Subject: (*F* SPAM *F*) $h_old-subject:"
        logwrite "---Marking as spam---"
endif

SA successfully processes letters and gives them points, but the system filter does not work. I understand that SA does not put a flag on letters that are marked as spam. What condition should I put in the if in the filter so that Exim can successfully change the headers of spam emails without touching the regular ones?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Voitenko, 2014-07-23
@OliverV

If I'm not mistaken then X-Spam-Flag: 1, not Yes. But I could be wrong, there is no way to look at their servers right now.

A
Archiba, 2014-07-23
@Archiba

I understand that SA cannot modify the messages in this bundle itself, so it simply checks and reports that the letter is / is not spam to Exim, which in turn, based on this information, must modify the letter as we need. But I don't understand what condition to put in the system filter so that Exim understands that this message is spam.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question