Spam Trap

Request and discuss new features you would like to have.
Post Reply
efa-user
Posts: 18
Joined: 27 Jul 2017 10:59

Spam Trap

Post by efa-user » 27 Jul 2017 11:15

I have a number of addreses and even whole domains where i do not ever expect to receive any valid mails, would it be possible to add the ability to nominiate these as 'spam traps' whereby all mail received is fed into SA using 'sa-learn --spam' either before or after the normal scanning takes place?

ie something like what is described in the section titled "SA-Lean script coupled with Spam Trap" on this page:

https://freedif.org/improve-spamassassi ... spam-trap/

Thanks

User avatar
BruceLeeRoy
Posts: 43
Joined: 01 May 2015 13:27

Re: Spam Trap

Post by BruceLeeRoy » 12 Sep 2018 15:04

I was searching for a similar feature. there are several email accounts that were closed over 10 years ago on my mail server that are still getting hammered. I have blacklisted them in EFA to cut down on backscatter and excessive traffic to and from the mail server. I occasionally go through the logs and mark them as spam in sa-learn. It would be nice to automate this process or even setup spam traps on domains that I manage. Thinking spammers might realize spam traps exist on my domains might also cut down on spam they send to my domains?

User avatar
BruceLeeRoy
Posts: 43
Joined: 01 May 2015 13:27

Re: Spam Trap

Post by BruceLeeRoy » 14 Sep 2018 11:53

Actually I just found that you can run a filter for your spam trap then click "Message Operations" where you can flag the whole page of results to learn as spam.

benscha
Posts: 19
Joined: 23 Jan 2018 07:19

Re: Spam Trap

Post by benscha » 08 Oct 2019 11:08

Hi Guys

i have scripted a small solution that will be started by a cron job.

you need a file with your spamtrap addresses (one per line) and read this in the script.

Code: Select all

#Read a File with some Spamtrap Addresses and extracts information from maillog

while read sender
do
grep $sender /var/log/maillog >>/tmp/autolearn_spam_raw
done < /scripts/spamtrap_addresses #File with your Spamtrap Adresses


 
#gets the message ID from the last output
 
grep ': Message' /tmp/autolearn_spam_raw | awk '{print $7 >"/tmp/autolearn_spam"; }'

#set date for spam path
d=`date +%Y%m%d`


#sa-learn the specific mails
while read mail
do
sa-learn --spam /var/spool/MailScanner/quarantine/$d/spam/$mail --progress
done < /tmp/autolearn_spam



rm -rf /tmp/autolearn_spam
rm -rf /tmp/autolearn_spam_raw
enjoy it...
always happy for any hints and tipps! :clap: | EFA 3.0.2.6

User avatar
shawniverson
Posts: 2842
Joined: 13 Jan 2014 23:30
Location: Rushville, Indiana, USA
Contact:

Re: Spam Trap

Post by shawniverson » 15 Oct 2019 18:39

Awesome 8-)
Version eFa 4.0.0 RC3 now available in testing repo. Come join us in advancing eFa!

Post Reply