[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Blocking mail by subject.



Oleg Goldshmidt <ogoldsh@netvision.net.il> writes:

> :0 h
> | formail -xSubject: | egrep -f /etc/mail/spamdb - >/dev/null 

What kind of BS is that? It's not buggy, it's stupid. I am tired.

I meant, of course, that 'formail | egrep -f' will match the subject,
and then the mail itself should go either to /dev/null or to $ORGMAIL,
sth like (STILL UNTESTED, but hopefully less stupid than before):

:0 Whc: spam.lock
| formail -xSubject: | egrep -qf /etc/mail/spamdb -
    
:0 a:
/dev/null

I hope this works as follows: formail grabs the subject and
passes to egrep that tries to match patterns from /etc/mail/spamdb.
Now if a match is found (egrep quietly returns 0), the next rule
is executed, sending the message where it belongs.

Another option that comes to mind is sth like

SPAM=`awk '{printf "%s%s", (NR>1) ? "|" : "", $0}' /etc/mail/spam.db`

:0:
* ^Subject.*(${SPAM})
/dev/null

[I don't like it, really, need to keep an eye on $LINEBUF etc].

In any case, don't trust me, but man procmail{,rc,ex}

Sorry for the mix-up.

-- 
Oleg Goldshmidt <ogoldsh@NOSPAM.netvision.net.il> 
"Inventions ... cannot, in nature, be a subject of property."
T. Jefferson. 

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il