procmail
[Top] [All Lists]

Re: Mail filtering

1997-12-25 23:11:42
zhenhua wrote:

Here is what I want to do:

Mail specifically addressed to me: zhenhua(_at_)megapro(_dot_)com
Accept, do not do anything

Mail specifically addressed to a maillist I subscribed to:
        procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de
Accept, do not do anything

Other mails (addressed to: free(_at_)public(_dot_)com, 
junk(_at_)hotmail(_dot_)com
  ... etc but with my emailed embeded in it)
Do not accept, send them to: /dev/null

Basically, I want to email addressed to me whose To: field
specifies: zhenhua(_at_)megapro(_dot_)com
to go to my regular mailbox, not a folder.

Other mails go to: /dev/null since they are sending to me
with a faked To: field.

  I use something very similar to your ideas.  Here is part of my
.procmailrc, modified to work for you.  It assumes the existance
of a subdiretory in my home account called ".nospam".  I do *NOT*
recommend automatically sending stuff to /dev/null; there are simply
too many things that can go wrong.  Keep a temporary backup and
clean it out once every week or so.  In my case, the the backup
file is called "OOPS".  The following recipie accepts Email...
  1) from your ISP, eg. accounting, techsupport, etc.
  2) addressed to you or the procmail list.
  There is no need to explicitly filter out stuff addressed...
"To: friend(_at_)public(_dot_)com".  It's automatically filtered out.  I
had originally filtered all my mailing lists on their full
"To:" address.  However, I lost a day's worth of email when one
list changed its server on short notice.  Since then, I've used
a topic keyname that occurs in the list title.  Even if this
list does change servers tonight, the word "procmail" will
likely still be in the new title.

###############################################
MAILDIR=$HOME/.nospam
LOGFILE=$MAILDIR/HEADERS
BACKUPFILE=$MAILDIR/OOPS
LOGABSTRACT=NO

:0: rejects1.lock
* !^(Sender|From|Reply-To):.*megapro\.com
* !^(To|Cc|Bcc):.*(zhenhua|procmail)
  $BACKUPFILE
###############################################

    The above is a stripped-down version of my .procmailrc,
which has gotten quite fancy.

-- 
Walter Dnes
waltdnes(_at_)interlog(_dot_)com


<Prev in Thread] Current Thread [Next in Thread>