When setting up a user, I thought that if I cleared the checkbox "Scan e-mail for Spam" for the "Scan for Spam" setting, it would allow email to pass through unscanned and maybe stored. When I test things, I am still seeing the X-Spam-Status messages, so it appears to be scanned and stored. I actually like that they are still stored.
To test, I sent from another domain and account separate messages to two efa accounts on the same domain with one account having the checkbox cleared, and the headers are identical. I did restart mailscanner from an SSH shell previous to trying this.
This is for MailWatch for MailScanner v1.2.23 running on eFa-5.0.0-11 with
Operating System Version: CentOS Stream 9
Postfix Version: 3.5.25
MailScanner Version: 5.5.1
ClamAV Version: 1.0.8
SpamAssassin Version: 4.0.1
PHP Version: 8.1.27
MySQL Version: 10.5.27-MariaDB
-Steve
"Scan for Spam" setting
Re: "Scan for Spam" setting
I found the custom end function SQLSpamScores that seems to process the database noscan variable in the SQLSpamSettings.pm perl module. Unfortunately, I don't know perl other than regex/PCRE, so I don't know exactly what is going on. I did find the following code though.
I did a grep of the log and only found traces of the first two. There is no "No Scan" messages in the logs.
Is it not being called for some reason?
-Steve
Code: Select all
#
# Close down Spam Settings lists
#
sub EndSQLSpamScores
{
MailScanner::Log::InfoLog("MailWatch: SQLSpamSettings:: Closing down MailWatch SQL Spam Scores");
}
sub EndSQLHighSpamScores
{
MailScanner::Log::InfoLog("MailWatch: SQLSpamSettings:: Closing down MailWatch SQL High Spam Scores");
}
sub EndSQLNoScan
{
MailScanner::Log::InfoLog("MailWatch: SQLSpamSettings:: Closing down MailWatch SQL No Scan");
}
Code: Select all
...MailScanner[3864919]: Config: calling custom end function SQLSpamScores
...MailScanner[3864919]: MailWatch: SQLSpamSettings:: Closing down MailWatch SQL Spam Scores
...MailScanner[3864999]: MailWatch: SQLSpamSettings:: Closing down MailWatch SQL High Spam Scores
-Steve
Re: "Scan for Spam" setting
Guessing by the lack of response, I'm the only one having issues with the no scan.
Just closing out this thread to say that I got it to work the way I need with rules and a bit of bash scripting for a cron job.
In the unlikely event someone lands here....
Change the setting in MailScanner.conf: Scan Messages = %rules-dir%/scan.messages.rules
The scan.messages.rules is where you add exemptions from scanning.
You also need to change the setting of in MailScanner.conf: Non Spam Actions = %rules-dir%/nonspam.actions.rules
The nonspam.actions.rules is where you change the Non Spam Actions to either
store deliver <--- This is for the exemption users
store deliver header "X-Spam-Status:No" custom(nonspam) <--- this is for the normal users.
You cannot edit the nonspam.actions.rules from the webpage editor though. It doesn't like the " character, so edit it from a shell.
The bash script with the cron job just creates these files once a day after scanning the database.
-Steve
Just closing out this thread to say that I got it to work the way I need with rules and a bit of bash scripting for a cron job.
In the unlikely event someone lands here....
Change the setting in MailScanner.conf: Scan Messages = %rules-dir%/scan.messages.rules
The scan.messages.rules is where you add exemptions from scanning.
You also need to change the setting of in MailScanner.conf: Non Spam Actions = %rules-dir%/nonspam.actions.rules
The nonspam.actions.rules is where you change the Non Spam Actions to either
store deliver <--- This is for the exemption users
store deliver header "X-Spam-Status:No" custom(nonspam) <--- this is for the normal users.
You cannot edit the nonspam.actions.rules from the webpage editor though. It doesn't like the " character, so edit it from a shell.
The bash script with the cron job just creates these files once a day after scanning the database.
-Steve