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