[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[2]: [vps-mail] procmail : about reading info from ASCII files
- Subject: Re[2]: [vps-mail] procmail : about reading info from ASCII files
- From: Abigail Marshall <webmaster@xxxxxxxxxxxx>
- Date: Sat, 8 Nov 2003 17:17:59 -0800
A> Abigail Marshall wrote:
A> The point would be to be able to use regex and other tricks procmail
A> allows, using the macros TO for example. AFAIK etc/access mechanism
A> would only allow blocking a From:distinct.example.com or example.com (in
A> Received headers.) Also no subject or other headers can be blocked.
OK, the syntax for including an external file in procmail is
this:
INCLUDERC= path/to/filename
I think you can put an INCLUDERC call in the middle of a
recipe if you want. That is, I THINK you could have a recipe
like this:
:0 H:
INCLUDERC= path/to/blocklist
/dev/null
But I might be very mistaken on that one - I've never
actually tried it. (I'm hoping Scott comes in an sets me
straight if I am). Maybe Scott's egrep command is better.
As far as regexps go, this recipe does good things for me:
# Test: Spammy domain name
:0H
* 1^0 ^From:.*bargain
* 1^0 ^From:.*casino
* 1^0 ^From:.*credit
* 1^0 ^From:.*deal
* 1^0 ^From:.*discount
* 1^0 ^From:.*fulfillment
* 1^0 ^From:.*offers
* 1^0 ^From:.*offerz
* 1^0 ^From:.*offer@
* 1^0 ^From:.*optin
* 1^0 ^From:.*opt-in
* 1^0 ^From:.*daily
* 1^0 ^From:.*market
* 1^0 ^From:.*hi-speed
* 1^0 ^From:.*hispeed
* 1^0 ^From:.*mortgage
* 1^0 ^From:.*rewards
* 1^0 ^From:.*awards
* 1^0 ^From:.*sexy
{
LOG="Spammy sender "
:0
/var/mail/spam
}
I do send all these to a mailbox where I can review them by
hand, as there is an occasional false positive. I could use
regexps to clean this up a little (rather than having
separate entries for offers/offerz or optin/opt-in for
example) - but the list is so short I just haven't bothered.
-Abigail
======================================================================
This is <vps-mail@xxxxxxxxxxxx> <http://www.perlcode.org/lists/>
======================================================================
Main Index |
Thread Index