d0d307a
#################################################
d0d307a
# procmailrc
d0d307a
# This is the main procmail file with common SPAM recipes
d0d307a
# Based on the article at
d0d307a
# http://www.ncworldmag.com/ncw-05-1998/ncw-05-imap.html
d0d307a
# 
d0d307a
#
d0d307a
# First we define some basics
d0d307a
d0d307a
PATH=/usr/bin:/bin
d0d307a
SHELL=/bin/sh
d0d307a
d0d307a
# We define DELIVERTO just to prevent a lot of extra
d0d307a
# typing later on.  We define SPAMIT to prevent even more
d0d307a
# repetitive typing, as it's the same action for every user.
d0d307a
# This assumes we set up a SPAM folder right off the INBOX
d0d307a
# for every user on the system.  If we neglect to do that, we'll
d0d307a
# get in a bit of trouble.
d0d307a
d0d307a
DELIVERTO=/usr/cyrus/bin/deliver-wrapper
d0d307a
SPAMIT="$DELIVERTO user.$LOGNAME.SPAM"
d0d307a
d0d307a
# This file includes the appropriate procmail.$LOGNAME
d0d307a
# file so that each user has his or her own recipe techniques
d0d307a
# for subscribed lists, e-mail alerts, etc.
d0d307a
d0d307a
# Before we begin any recipes, let's make a backup
d0d307a
# copy of any incoming mail.
d0d307a
#
d0d307a
# Remember to comment out the next recipe once
d0d307a
# you know everything is working fine, otherwise
d0d307a
# you'll fill up the backup directory very quickly.
d0d307a
# Some procmail tutorials demonstrate how you can
d0d307a
# set a quota on the backup directory so that you can
d0d307a
# leave it in force at all times.
d0d307a
d0d307a
:0 ic
d0d307a
| $DELIVERTO user.$LOGNAME.Backup
d0d307a
d0d307a
###############################
d0d307a
# If there used to be an existing system-wide procmailrc, you can
d0d307a
# include it here
d0d307a
#INCLUDERC=/etc/procmailrc
d0d307a
d0d307a
# We shouldn't be running as a privileged user, but just in case,
d0d307a
# make sure we drop any privileges we have
d0d307a
DROPPRIVS=1
d0d307a
d0d307a
###############################
d0d307a
# If users want to be able to define their own private recipes
d0d307a
# and put them in their home .procmailrc files, comment out
d0d307a
# the next definition.
d0d307a
#
d0d307a
# These recipes will be processed BEFORE the user-specific
d0d307a
# recipes that are kept in the /home/cyrus directory
d0d307a
#
d0d307a
# setup some variables, before we start
d0d307a
ALERTSBOX=user.$LOGNAME.Folders.Alerts
d0d307a
LISTSBOX=user.$LOGNAME.Folders.Lists
d0d307a
#
d0d307a
INCLUDERC=$HOME/.procmailrc
d0d307a
d0d307a
# If you want to define user-specific recipes that
d0d307a
# you manage centrally (perhaps because you don't want
d0d307a
# to allow your users to "roll their own," then
d0d307a
# uncomment the following line.  In this case, you have
d0d307a
# to create a file for each user in the form:
d0d307a
# procmail.username -- for example, procmail.Joe
d0d307a
#
d0d307a
# INCLUDERC=/usr/cyrus/etc/procmail.$LOGNAME
d0d307a
d0d307a
#############################
d0d307a
# Now we begin our recipes
d0d307a
d0d307a
#############################
d0d307a
# Email-specific SPAM recipes
d0d307a
# Here's one example
d0d307a
d0d307a
#### NOTE: surely cyrus 'deliver' does its own locking? There should
d0d307a
#### thus be no need for :0:$LOGNAME.lock
d0d307a
d0d307a
:0
d0d307a
* ^To:.*anyplace@juno.com
d0d307a
| $SPAMIT
d0d307a
d0d307a
#############################
d0d307a
# General SPAM Recipes
d0d307a
# Here are a few examples
d0d307a
#
d0d307a
# The "To:" line doesn't exist
d0d307a
d0d307a
#:0
d0d307a
#* !^To:
d0d307a
#| $SPAMIT
d0d307a
d0d307a
# The "To:" line is empty
d0d307a
d0d307a
#:0
d0d307a
#* ^To: $
d0d307a
#| $SPAMIT
d0d307a
d0d307a
# The "From:" line is empty
d0d307a
d0d307a
#:0
d0d307a
#* ^From: $
d0d307a
#| $SPAMIT
d0d307a
d0d307a
#############################
d0d307a
# All the mail that falls
d0d307a
# through the above recipes
d0d307a
# will be put into the user's
d0d307a
# inbox.  This is always the LAST
d0d307a
# recipe to appear in the file.
d0d307a
d0d307a
:0W
d0d307a
| $DELIVERTO user.$LOGNAME
d0d307a
d0d307a
# If that fails - maybe because the user is out of quota, or the mailbox
d0d307a
# hasn't been created - then force a bounce (otherwise the message would
d0d307a
# get silently appended to /var/spool/mail/$LOGNAME).
d0d307a
d0d307a
# This is EX_CANTCREAT (Can't create output)
d0d307a
EXITCODE=73
d0d307a
:0
d0d307a
/dev/null
d0d307a
d0d307a
#
d0d307a
# End of procmailrc file
d0d307a
##############################