Where do I configure SpamAssassin?

Perhaps with another “stupid” or already addressed question, I’ve been searching and haven’t found any information that answers my question.

The thing is, SpamAssassin works. I send an email with the subject:

XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X

And it arrives in the spam folder like this:

*** SPAM *** XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X

That’s what it’s supposed to do, and someone else might say, “It works fine, I’ll leave it like that,” but… I’d like to know where to configure it, and I haven’t been able to find the file that configures that parameter. If I go to the Hestia panel and click on server configuration, I see the spamd file and the icon to edit it. When I edit it, I see that everything is commented out (everything has a # in front), so I understand that this file isn’t doing its job; it’s not adding ***SPAM*** to the subject line.

Even so, I edited it, removing the line I think is the problem (I uncommented it), but it’s still receiving ***SPAM*** instead of ****SPAM**** as I configured it.

Which is the same as editing the /etc/spamassassin/local.cf file.

So, where do we configure the spam levels, specifically how to add ***SPAM*** to the subject line, etc.?

As always, thanks.

1 Like

Spamassassin is not rewriting the subject but Exim does using this conf file /etc/exim4/system.filter and this is the part that modifies the subject:

if $h_X-Spam-Status: contains "Yes"
then
    headers add "Old-Subject: $h_subject"
    headers remove "Subject"
    headers add "Subject: *** SPAM *** $h_old-subject"
    headers remove "Old-Subject"
endif

Regarding Spamassassin conf files, they are here /etc/spamassassin/

3 Likes

Okay, I understand.
I’m getting used to this new system; I’ve been using a different panel for many years, Postfix instead of Exim… and there are some things I can’t seem to find, even though I’ve searched.
I see where you mention that it overwrites both spam and virus detection. So, we configure the spam score level in the file /etc/exim4/exim4.conf.template. There, at the beginning, I see this:

SPAMASSASSIN = yes SPAM_SCORE = 50 SPAM_REJECT_SCORE = 100 CLAMD = yes
And then, as you indicated, it’s /etc/exim4/system.filter that rewrites the subject.
If I’m wrong about anything, please correct me.

I understand that we don’t need to touch or modify anything in the files in /etc/spamassassin/. But what possible function does the file /etc/spamassassin/local.cf have?

Immensely grateful

All is correct.

You can do things like:

Adjust the spam score threshold.
Enable or disable specific spamassassin plugins.
Define custom rules.
Assign custom scores.
Whitelist or blacklist email addresses or domains.
Customize report templates.
etc.

2 Likes

Thanks for the reply,

So, if I understand correctly, the modifications you mentioned can be made in that file. I looked at it thoroughly and I see them (although everything is commented out), but only one point:
You mention modifying the spam score threshold. I see this in the file:

[code]
#Set the threshold at which a message is considered spam (default: 5.0)

#required_score 5.0 [/code]
(Sorry, not work code tag, I dont know the cause)

However, that field is in the file:

/etc/exim4/exim4.conf.template

This field is also there (which, incidentally, overwrites the subject):

spam_score = 50

I understand that 50 is the same as in the other 5.0. In this specific case, if I run cd spam score threshold, does the configuration in /etc/spamassassin/local.cf overwrite the one in /etc/exim4/exim4.conf.template? As I mentioned, I’m only referring to the spam score.

I’m asking because I noticed that overwriting the subject line wasn’t happening in /etc/spamassassin/local.cf.

(I hope I’ve explained myself clearly.)

Thank you very much!

SPAM_SCORE

SPAM_REJECT_SCORE

should really be exposed on the web ui settings maybe for a future hestia update? I understand you can edit the exim file from the webui but not very intuitive

Those two fields/values ​​you mentioned are in the file /etc/exim4/exim4.conf.template, which, being at the top of the file, are accessible and visible. We have access to the /etc/spamassassin/local.cf file via the web UI, but that’s where my question lies: we can modify the spam score value, but… does this overwrite the value in /etc/exim4/exim4.conf.template?

Select the text and click on button </>

Exim does not recognize floating-point numbers, so the SpamAssassin score must be multiplied by 10. If you want an email to be marked as spam at a score of 6.4 in SpamAssassin, you need to configure it as 64 in Exim.

No, the configuration in /etc/spamassassin/local.cf doesn’t overwrite the configuration in /etc/exim4/exim4.conf.template but you should use the same score in both, exim and spamassassin.

2 Likes

Thanks for the clarification :slight_smile:

Well, it couldn’t be explained any better. Thank you so much!
Although it might sound a bit “silly,” the /etc/spamassassin/local.cf file is fully commented out (except for a few references to SpamAssassin), but everything else is commented out. Therefore, as I understand it, the relevant file is /etc/exim4/exim4.conf.template, even though both should contain the same information, because the other one is commented out…

As I said, thanks a million, I don’t think it could be explained any better :slight_smile:

2 Likes

The default score in Spamassassin is 5.0 so there is no need to uncomment it local.cf and thats also the reason 50 is the score configured in Exim.

2 Likes

Yes, it’s a good value/score ( 5.0 / 50 ), it works correctly that way; it was just to understand how it works.

Thank you very much.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.