[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: procmail + cyrus-imap



Ralf Lieb <rlieb1@htwm.de> writes:


> Ich bekomm' das Filtern mit
> procmail in die imap-Boxen nicht gebacken.

Ich hab das folgende irgendwo irgendwann mal im Netz gefunden.
Funkt bestens mit Cyrus.
Auch wenn ich mittlerweile nur noch Gnus Splitting nehme :)

#################################################
# procmail.common 
# This is the main procmail file with common SPAM recipes
#
# First we define some basics

PATH=/usr/bin:/usr/local/bin
SHELL=/bin/sh
VERBOSE=OFF
LINEBUF=8192
PMDIR="/var/log/procmail"

:0 D
* $LOGNAME ?? [A-Z]
{
    LOGNAME=`echo "$LOGNAME" | tr A-Z a-z`
}

USER=$LOGNAME

# We define DELIVERMAIL 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.

DELIVERMAIL=/usr/sbin/cyrdeliver
SPAMIT="$DELIVERMAIL -a $LOGNAME -m user.$LOGNAME.SPAM"
USER_ROOT = user.$LOGNAME

LOGFILE=/var/log/procmail/proclog

:0fw
| /usr/local/bin/spamc -f -s 5000000

:0e
{
    EXITCODE=$?
}

:0 fhw
| formail -I "From "

:0
* ^X-Spam-Status: Yes
| $SPAMIT

:0
* ^Subject:.*\*\*\*\*\*SPAM\*\*\*\*\*.*
| $SPAMIT

:0
* ^Subject:.*=?ks_c_5601-1987?.*
| $SPAMIT

# 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
#/tmp/backup

###############################
# 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
# 
# INCLUDERC=/home/$LOGNAME/.procmailrc
#
# If you do NOT want to define any user-specific recipes
# that you manage centrally (perhaps because you only want
# to allow your users to "roll their own," then 
# comment out the following line.  Otherwise, you have
# to create a file for each user in the form: 
# procmail.username -- for example, procmail.Joe

# INCLUDERC=/var/lib/cyrus/procmail/proc.$LOGNAME

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

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

#############################
# 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
* EXTENSION ?? [a-z]
| $DELIVERMAIL -a $LOGNAME -m user.$LOGNAME.$EXTENSION

:0w
| $DELIVERMAIL -a $LOGNAME -m user.$LOGNAME

:0 e
{
	EXITCODE=$?
	HOST
}

#
# End of procmail.common file
##############################


-- 
begin  OjE-ist-scheisse.txt
bye, Joerg                 Encrypted Mail preferred!
Registered Linux User #97793 @ http://counter.li.org
end


-- 
Zum AUSTRAGEN schicken Sie eine Mail an debian-user-german-request@lists.debian.org
mit dem Subject "unsubscribe". Probleme? Mail an listmaster@lists.debian.org (engl)



Reply to: