Page 1 of 1
MailScanner Report removed from spam.whitelist.rules
Posted: 25 Jun 2011, 23:07
by jimhermann
How do I keep the system from removing my custom spam.whitelist.rules?
I received an email with Subject: cPanel -> MailScanner Report
It included a bunch of lines like this:
foreign-domain-name removed from spam.whitelist.rules
The foreign-domain-name was a custom whitelist rule that I had added before I switched to cPanel:
From: yyyyy@foreign-domain-name and To: aaaaa@local-domain-name yes
I can't add this whitelist rule with the MailScanner FE. It only allows all To:, all From:, or all FromTo:. It does not allow the From: and To: format.
Thanks.
Jim
Re: MailScanner Report removed from spam.whitelist.rules
Posted: 29 Jun 2011, 05:25
by jimhermann
I found the solution to my problem.
I had to modify the /usr/mscpanel/mscpanel-dot-pl program:
# diff /usr/mscpanel/mscpanel-dot-pl /usr/mscpanel/mscpanel-dot-pl-dot-org
260c260
< if (($swr[$x] =~ /\@([^\t\s\*]*)/) and ($swr[$x] !~ /\#/)) {
---
> if (($swr[$x] =~ /\@([^\t\s\*]*)/) and ($swr[$x] !~ /^\#/)) {
Did you notice the change that I made to line 260?
The original version matches only lines that don't start with #
The modified version matches only lines that don't contain a # anywhere in the line.
So I changed my custom spam.whitelist.rule file to end custom rules with a #
For example:
From: yyyyy@foreign-domain-name and To: aaaaa@local-domain-name yes #
Life is good until the next /usr/mscpanel/mscpanel-dot-pl update.
Re: MailScanner Report removed from spam.whitelist.rules
Posted: 15 Feb 2013, 12:28
by Daroch
Hello, Jimhermann:
Thanks for your advice. Works great with the black list and white list.
Unfortunately, the same problem exists with spam.scanning.rules files. It is overridden when the command /usr/mscpanel/mscpanel(dot)pl is executed.
I tried the same method, modifying the file mscpanel(dot)pl (line 219) and putting a "#" at the end of the linesin spam.scanning.rules but does not work :-(
I think there is another problem in the future. when upgrading the frontend Mailscanner, mscpanel(dot)pl file changes will be lost, right?
Is this normal function Mailscanner? Is there anyone with this problem?
Our versions:
MailScanner - v4.84.5
ConfigServer MailScanner Script - v2.88
ClamAV - v0.97.6
MailScanner Front-End - v4.38
Thanks and sorry for reviving an old post
Re: MailScanner Report removed from spam.whitelist.rules
Posted: 06 Feb 2015, 17:58
by Bigwebmaster
Had this same issue with whatever lines I was adding to the spam.whitelist.rules being removed daily. Looked at the programming and the problem is this line like mentioned above:
Code: Select all
if (($swr[$x] =~ /\@([^\t\s\*]*)/) and ($swr[$x] !~ /^\#/)) {
if (not $validdomains{$1} and ($1 ne "") and ($1 ne "*")) {splice (@swr,$x,1);$report .= "$1 removed from spam.whitelist.rules\n";$altered = 1}
}
The real problem with this line is that it is comparing the domain it finds in the line to $validdomains. The $validdomains array only contains domains that reside on the server so it makes no sense to even compare to this as you will want to whitelist domains outside of the server. The way it works now is that unless a domain is local in spam.whitelist.rules file, the line will be removed. All local domains on this whitelist will stay. It also does this for the blacklist file and it shouldn't. So to fix this simply remove this block of code as there is no reason for it:
Code: Select all
for ($x=0;$x < @sbr;$x++) {
if (($sbr[$x] =~ /\@([^\t\s\*]*)/) and ($sbr[$x] !~ /^\#/)) {
if (not $validdomains{$1} and ($1 ne "") and ($1 ne "*")) {splice (@sbr,$x,1);$report .= "$1 removed from spam.blacklist.rules\n";$altered = 1}
}
}
for ($x=0;$x < @swr;$x++) {
if (($swr[$x] =~ /\@([^\t\s\*]*)/) and ($swr[$x] !~ /^\#/)) {
if (not $validdomains{$1} and ($1 ne "") and ($1 ne "*")) {splice (@swr,$x,1);$report .= "$1 removed from spam.whitelist.rules\n";$altered = 1}
}
}