I am tired of all the CANVAS PRINT spam that got into the email accounts in the server and created the following 2 rules, one for the AntiSpam and one for csf.custom.rules, working both together my server is blocking the email with the AntiSpam and CSF blocks the IP that sent the email at the same time.
Both rules are working in CloudLINUX with WHM 100.0.5
First, create a rule for SpamAssassin used by MailScanner at: /etc/mail/spamassassin
FILE NAME: blacksubjects.cf
RULE:
Code: Select all
header SECMAS_CANVASPAM Subject =~ /Canvas/i
score SECMAS_CANVASPAM 22
describe SECMAS_CANVASPAM Canvas Spam
Then add the following rule at: /usr/local/csf/bin/regex.custom.pm
Code: Select all
SMTPAUTH_LOG: /var/log/exim_mainlog
# BLOCKING RECURRENT SPAM
if (($lgfile eq $config{SMTPAUTH_LOG}) and ($line =~ /^\S+\s\S+\s\S+\s<=\s\S+\sH=(?>\S+\s)+?\[(\S+)\](?>\S+\s)+?T=".*(?>canvas print)/i)) {
return ("RECURRENT SPAM1",$1,"SPAM_RECURRENT1","1","1","1");
}
If you got the idea, then you can play with both rules and add more spam on both rules, like this:
Code: Select all
Directory: /etc/mail/spamassassin
FILE NAME: blacksubjects.cf
header SECMAS_VARIOUSPAM Subject =~ /(Canvas|Asian Bride Girl)/i
score SECMAS_VARIOUSPAM 22
describe SECMAS_VARIOUSPAM Various Spam
- - - - - -
Add the following rule at: /usr/local/csf/bin/regex.custom.pm
SMTPAUTH_LOG: /var/log/exim_mainlog
# BLOCKING RECURRENT SPAM
if (($lgfile eq $config{SMTPAUTH_LOG}) and ($line =~ /^\S+\s\S+\s\S+\s<=\s\S+\sH=(?>\S+\s)+?\[(\S+)\](?>\S+\s)+?T=".*(?>canvas print|Asian Bride Girl)/i)) {
return ("RECURRENT SPAM1",$1,"SPAM_RECURRENT1","1","1","1");
}
Disclaimer: Use the above info at you own risk, I don't assume any responsibility if you use it.
MERRY CHRISTMAS AND HAPPY NEW YEAR 2022!!