Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Blocking TLD Spammers with Procmail Recipe
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
figueroa
Guru
Guru


Joined: 14 Aug 2005
Posts: 433
Location: GA-USA

PostPosted: Mon Feb 25, 2019 7:10 pm    Post subject: Blocking TLD Spammers with Procmail Recipe Reply with quote

Running my own private email server (just family), with email addresses that go back to mid 90's, so some of them are spam magnets. Recently I've been able to coral over 90% of spam by using a specific procmail recipe against the Return-path header. Adjust to suit your taste and experience. I'm getting zero false positives. I do check my procmail log as well as the .junk folder to which these are dispatched. YMMV.
Code:
:0
* ^Return-Path.*@([-a-z0-9_\.]+)(\.stream>|\.info>|\.bi.>|\.date>|\.win>|\.c.\.cc>|\.top>|\.webcam>|\.me>|\.tv>|\.party>|\.faith>|\.review>|\.site>|\.trade>|\.click>|\.link>|\.rocks>|\.space>|\.work>|\.xxx>|\.xyz>|\.club>|\.press>|\.cricket>|\.download>|\.science>|\.study>|\.gdn>|\.men>|\.site>|\.world>|\.agency>|\.today>|\.icu>|\.life>|\.live>|\.fun>|\.pro>|\.loan>|\.gq>|\.store>)
{
LOG="Sender Domain Rule Return Path - "
:0: senderdom1
.junk/
}

:0
* ^From.*@([-a-z0-9_\.]+)(\.stream>|\.info>|\.bi.>|\.date>|\.win>|\.c.\.cc>|\.top>|\.webcam>|\.me>|\.tv>|\.party>|\.faith>|\.review>|\.site>|\.trade>|\.click>|\.link>|\.rocks>|\.space>|\.work>|\.xxx>|\.xyz>|\.club>|\.press>|\.cricket>|\.download>|\.science>|\.study>|\.gdn>|\.men>|\.site>|\.world>|\.agency>|\.today>|\.icu>|\.li[fv]e>|\.fun>|\.pro>|\.loan>|\.gq>|\.store>)
{
LOG="Sender Domain Rule From - "
:0: senderdom2
.junk/
}


I realize that my use of the regex @([-a-z0-9_\.]+) would allow (find) -, _, or . to be in the first few spaces of a domain name (not legal), but in practice, it works too good to be true.

Inspired by: http://www.elisanet.fi/tsalmi/info/proctips.html
_________________
Andy Figueroa
andy@andyfigueroa.net Working with Unix since 1983.
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6316
Location: /usr/lib64/lv2

PostPosted: Wed Mar 06, 2019 7:34 pm    Post subject: Reply with quote

Very nice. :)
_________________
Gentoo Studio: A Gentoo-based, professional digital audio workstation OS.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum