Fix testsuite case 0373.
[exim.git] / configs / config.samples / C047
CommitLineData
e0f3765a
PH
1From: Oliver Egginger <Oliver.Egginger@dvz.fh-giessen.de>
2Date: 21 May 2003 10:11:16 +0200
3
4Hi there,
5
6download the spamassassin package. See
7http://au.spamassassin.org/downloads.html
8
9Define a router in your Exim configuration file.
10For Exim 4 it could look like this:
11
12# Spam Assassin
13spamcheck_router:
14 no_verify
15 check_local_user
16 # When to scan a message :
17 # - it isn't already flagged as spam
18 # - it isn't already scanned
19 # - comes from ABC.DEF.GHI.JKL or MNO.PQR.STU.VWX
20 # - .spamcheck exists for this user
21 condition = \
22 "${if and { {!def:h_X-Spam-Flag:} \
23 {!eq {$received_protocol}{spam-scanned}} \
24 {or { {eq {$sender_host_address}{ABC.DEF.GHI.JKL}} \
25 {eq {$sender_host_address}{MNO.PQR.STU.VWX}} \
26 }\
27 }\
28 }\
29 {1}{0}\
30 }"
31 require_files = $home/.spamcheck
32 driver = accept
33 transport = spamcheck
34
35
36This router has two advantages (for us):
37
381. You can define the sender host addresses from which you will scan the spam.
39In my example there are ABC.DEF.GHI.JKL and MNO.PQR.STU.VWX (you have to
40substiute this by your real IP-Adresses).
41
422. The spamcheck router only runs in dependency of the existence of the
43.spamcheck file. So your users can decide whether or not they wont to use
44Spamassassin. Thats important for protection of privacy in germany.
45
46If you don't need this you can simplify the router, for example:
47
48# Spam Assassin
49spamcheck_router:
50 no_verify
51 check_local_user
52 # When to scan a message :
53 # - it isn't already flagged as spam
54 # - it isn't already scanned
55 condition = \
56 "${if and { {!def:h_X-Spam-Flag:} \
57 {!eq {$received_protocol}{spam-scanned}} \
58 }\
59 {1}{0}\
60 }"
61 driver = accept
62 transport = spamcheck
63
64
65In the end you will need a spamcheck transport. This one works well for us:
66
67# Spam Assassin
68spamcheck:
69 driver = pipe
70 command = /usr/exim/bin/exim -oMr spam-scanned -bS
71 use_bsmtp = true
72 transport_filter = /usr/bin/spamc
73 home_directory = "/tmp"
74 current_directory = "/tmp"
75 # must use a privileged user to set $received_protocol on the way
76 # back in!
77 user = mail
78 group = mail
79 log_output = true
80 return_fail_output = true
81 return_path_add = false
82 message_prefix =
83 message_suffix =
84
85
86Put the router and the transport on the right places in your exim conf and send
87the daemon a HUP signal. Thats all.
88
89- oliver