Procmail: Difference between revisions
From Hackepedia
Jump to navigationJump to search
Feel free to add different filters to the example |
mNo edit summary |
||
| Line 14: | Line 14: | ||
LOGFILE=${HOME}/.maillog | LOGFILE=${HOME}/.maillog | ||
DEFAULT=$MAILDIR | DEFAULT=$MAILDIR | ||
# This places any emails To or Cc * | # This places any emails To or Cc *gwbush* into the ether. | ||
:0: | :0: | ||
* ^(To|Cc):.* | * ^(To|Cc):.*gwbush* | ||
/dev/null | /dev/null | ||
# The following are examples for a few popular mailing lists, in which it will | # The following are examples for a few popular mailing lists, in which it will | ||
Revision as of 13:04, 21 February 2006
Procmail is an autonomous mail processor.
It can be invoked at the individual user level simply by placing the following text inside of $HOME/.forward
"|exec /usr/local/bin/procmail || exit 75"
note the above must include the absolute path to procmail. After that, now you can begin the fun by creating a .procmailrc Here is a sample .procmailrc:
CLEAN=${HOME}/.maildir/
PATH=/usr/bin:/bin:/usr/local/bin:.
MAILDIR=${HOME}/.maildir/
LOCKFILE=${HOME}/.lockmail
LOGFILE=${HOME}/.maillog
DEFAULT=$MAILDIR
# This places any emails To or Cc *gwbush* into the ether.
:0:
* ^(To|Cc):.*gwbush*
/dev/null
# The following are examples for a few popular mailing lists, in which it will
# place the content into the folder prefixed with .
:0:
* ^Sender:.*yashy-hack@mail\.yashy\.com
.yashy-hack/
:0:
* ^(To|Cc):.*nmap-hackers@insecure\.org
.nmap-hackers/
:0:
* ^Subject:.*Politech*
.politech/
# Garbage filtering
# B = Body
:0
* ^Content-Type: multipart/alternative
* B ?? ^Content-Type: (audio/x-|application).*;.*$.*name=.*\.(scr|com|bat|pif|lnk|exe)$
.klez/
:0
* ^Content-Type: multipart/mixed
* B ?? ^Content-Type: (audio/x-|application).*;.*$.*name=.*\.(scr|com|bat|pif|lnk|exe)$
.yaha/
# This is if size is greater than
:0
* > 98400
.bigfile/