We get some pretty persistent spam and it's easy to block the first messages, but they always send a follow-up email with very generic terms that aren't that viable to filter by procmail. So I'd like to add the email sender to a blocklist at the same time that we're tossing their junk mail into /dev/null.
I was wondering if the standard setup allows for this, or if there is an approved way of doing it? The proposed way would be something like:
# First, catch and log SEO spammers before sending to /dev/null
:0
* B ?? (Google.s first page|1st page of Google|not ranking on Google|Google search results|isn.t appearing in Google)
* B ?? (May I send|send you a proposal|send you a quote|price list|send.*report)
{
# Extract and save the sender to a blocklist file
:0 c
| formail -rD -xFrom: | sed -e 's/.*<\(.*\)>.*/\1/' -e 's/[^a-zA-Z0-9\.@_-]//g' >> $HOME/.spam_senders
# Now trash the message
:0
/dev/null
}
Then at the end,
# Finally, block ALL messages from known spammers
:0
* ? formail -xFrom: | sed -e 's/.*<\(.*\)>.*/\1/' -e 's/[^a-zA-Z0-9\.@_-]//g' | grep -i -f $HOME/.spam_senders
/dev/null