procmail
[Top] [All Lists]

Recipient-in-subject filter

2003-07-08 12:34:33

Here's a rule (based on SPAMMISHNESS rules I've written about previously) to flag messages when the recipient username appears in the subject line (delimited by wordbreaks, not as a potential substring).


#
# rcpt_subj.rc
#
# 20030708/1132 SBS     Created
#
# SPAM check: detects the recipients username portion in the subject
#

# uses ENVTO (common extraction)

# First (and this only works when there IS an ENVTO), get the username
# portion of the envelope recipient.  The good news is that while the
# envelope-to header won't be added when a message has multiple local
# recipients, this particular test is for the recipient's username in
# the subject, so it shouldn't be delivered to multiple recipients
# anyway.
# If there's a match on the first condition, then check for a
# match of the username in the subject.

:0
* ENVTO ?? ^\/[^(_at_)]+
* $ ^Subject:.*\>$\MATCH\>
{
        SPAMVAL="+(${SPAMTHRESHOLD}*.70)"
        SPAMMISHNESS="${SPAMMISHNESS}${SPAMVAL}"
        SPAMNOTES="${SPAMNOTES}SPAM: ${SPAMVAL} Username in the subject${NL}"
}
---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Recipient-in-subject filter, Professional Software Engineering <=