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