-
Notifications
You must be signed in to change notification settings - Fork 0
/
mailfilter.sample
54 lines (44 loc) · 1.43 KB
/
mailfilter.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# set default Maildir
MAILDIR="$HOME/Maildir"
# check if we're called from a .qmail-EXT instead of .qmail
import EXT
if ( $EXT )
{
# does a vmailmgr user named $EXT exist?
# if yes, deliver mail to his Maildir instead
CHECKMAILDIR = `dumpvuser $EXT | grep '^Directory' | awk '{ print $2 }'`
if ( $CHECKMAILDIR )
{
MAILDIR="$HOME/$CHECKMAILDIR"
}
}
# Spamfilter
# Ordnerstruktur für Spamfilter
`test -d "$MAILDIR/.0 Spamfilter" || maildirmake "$MAILDIR/.0 Spamfilter"`
# `test -d "$MAILDIR/.0 Spamfilter.als Spam erkannt" || maildirmake "$MAILDIR/.0 Spamfilter.als Spam erkannt"`
`test -d "$MAILDIR/.0 Spamfilter.als Spam lernen" || maildirmake "$MAILDIR/.0 Spamfilter.als Spam lernen"`
`test -d "$MAILDIR/.0 Spamfilter.als Ham lernen" || maildirmake "$MAILDIR/.0 Spamfilter.als Ham lernen"`
# DSPAM
xfilter "/package/host/localhost/dspam/bin/dspam --mode=teft --deliver=innocent,spam --stdout"
# Spamassassin
xfilter "/usr/bin/spamc"
# Spam ausfiltern
if ( (/^X-DSPAM-Result: Spam/) || (/^X-Spam-Flag: YES/:h) || (/^X-Spam-Status: Yes/:h) )
{
# in den Spamordner und beenden
to "$MAILDIR/.Spam"
}
# POPFile
xfilter "cd /home/lysip/opt/popfile && /usr/bin/perl pipe.pl 2> /home/lysip/popfile.err"
DestDir = $MAILDIR
/^X-Text-Classification: (.*)$/:h
if ($MATCH1)
{
DestDir = `/usr/bin/perl /home/lysip/opt/popfile/find-maildir.pl "$MAILDIR" "$MATCH1"`
if ($DestDir eq "")
{
DestDir = $MAILDIR
}
}
# Standardregel
to "$DestDir"