Blob Blame History Raw
#################################################
# procmailrc
# This is the main procmail file with common SPAM recipes
# Based on the article at
# http://www.ncworldmag.com/ncw-05-1998/ncw-05-imap.html
# 
#
# First we define some basics

PATH=/usr/bin:/bin
SHELL=/bin/sh

# We define DELIVERTO just to prevent a lot of extra
# typing later on.  We define SPAMIT to prevent even more
# repetitive typing, as it's the same action for every user.
# This assumes we set up a SPAM folder right off the INBOX
# for every user on the system.  If we neglect to do that, we'll
# get in a bit of trouble.

DELIVERTO=/usr/cyrus/bin/deliver-wrapper
SPAMIT="$DELIVERTO user.$LOGNAME.SPAM"

# This file includes the appropriate procmail.$LOGNAME
# file so that each user has his or her own recipe techniques
# for subscribed lists, e-mail alerts, etc.

# Before we begin any recipes, let's make a backup
# copy of any incoming mail.
#
# Remember to comment out the next recipe once
# you know everything is working fine, otherwise
# you'll fill up the backup directory very quickly.
# Some procmail tutorials demonstrate how you can
# set a quota on the backup directory so that you can
# leave it in force at all times.

:0 ic
| $DELIVERTO user.$LOGNAME.Backup

###############################
# If there used to be an existing system-wide procmailrc, you can
# include it here
#INCLUDERC=/etc/procmailrc

# We shouldn't be running as a privileged user, but just in case,
# make sure we drop any privileges we have
DROPPRIVS=1

###############################
# If users want to be able to define their own private recipes
# and put them in their home .procmailrc files, comment out
# the next definition.
#
# These recipes will be processed BEFORE the user-specific
# recipes that are kept in the /home/cyrus directory
#
# setup some variables, before we start
ALERTSBOX=user.$LOGNAME.Folders.Alerts
LISTSBOX=user.$LOGNAME.Folders.Lists
#
INCLUDERC=$HOME/.procmailrc

# If you want to define user-specific recipes that
# you manage centrally (perhaps because you don't want
# to allow your users to "roll their own," then
# uncomment the following line.  In this case, you have
# to create a file for each user in the form:
# procmail.username -- for example, procmail.Joe
#
# INCLUDERC=/usr/cyrus/etc/procmail.$LOGNAME

#############################
# Now we begin our recipes

#############################
# Email-specific SPAM recipes
# Here's one example

#### NOTE: surely cyrus 'deliver' does its own locking? There should
#### thus be no need for :0:$LOGNAME.lock

:0
* ^To:.*anyplace@juno.com
| $SPAMIT

#############################
# General SPAM Recipes
# Here are a few examples
#
# The "To:" line doesn't exist

#:0
#* !^To:
#| $SPAMIT

# The "To:" line is empty

#:0
#* ^To: $
#| $SPAMIT

# The "From:" line is empty

#:0
#* ^From: $
#| $SPAMIT

#############################
# All the mail that falls
# through the above recipes
# will be put into the user's
# inbox.  This is always the LAST
# recipe to appear in the file.

:0W
| $DELIVERTO user.$LOGNAME

# If that fails - maybe because the user is out of quota, or the mailbox
# hasn't been created - then force a bounce (otherwise the message would
# get silently appended to /var/spool/mail/$LOGNAME).

# This is EX_CANTCREAT (Can't create output)
EXITCODE=73
:0
/dev/null

#
# End of procmailrc file
##############################