source: npl/mailserver/dspam/dspam-3.10.2/doc/exim.txt @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 4.1 KB
RevLine 
[c5c522c]1$Id: exim.txt,v 1.1 2005/03/11 21:16:03 jonz Exp $
2
3EXIM 4 INTEGRATION
4
5Please follow the instructions in the README for building DSPAM. Once DSPAM
6has been built, the following instructions may be used to integrate it with
7exim.
8 
9To integrate DSPAM with exim 4, you'll need to create a new director in the
10exim configuration.  First, add the following code to the directors:
11
12spamscan:
13  no_verify
14  condition = "${if and {{!eq {$received_protocol}{spam-scanned}} {!eq {$received_protocol}{local}} } {1}{0}}"
15  driver = accept
16  transport = spamcheck
17  require_files = /usr/local/var/dspam:\
18    +/usr/local/bin
19
20This code tells exim to run spamcheck unless the message was marked by
21the agent with the spam-scanned protocol, or if it is local mail (to prevent
22loops).
23
24If you're using an alternative prefix, adjust the pathnames to match.
25
26Then add the following code to the transports section. This code defines
27how dspam is called by exim for scanning email:
28
29spamcheck:
30  driver = pipe
31  command = /usr/local/bin/dspam --deliver=innocent --user $local_part -- %u
32  user = mail
33  group = mail
34  return_path_add = false
35  log_output = true
36  return_fail_output = true
37
38If you're using virtual users on the system, you may wish to include the
39domain as part of the username:
40
41  command = /usr/local/bin/dspam --deliver=innocent --user "$local_part@$domain" -- %u
42
43Finally, you will need to configure and compile DSPAM. DSPAM will most likely
44end up calling exim again for delivery, using the spam-scanned protocol to
45identify scanned messages. The most common example is:
46
47   ./configure --with-delivery-agent="/usr/sbin/exim -oMr spam-scanned"
48
49RUNNING WITHOUT PRIVILEGED EXIM USERS
50
51The problem with setting the $received_protocol in the transport is that only
52privileged Exim users are allowed to do so. With the setup below, DSPAM can
53run as a nonprivileged user. The problem, however, is that this header could
54be easily spoofed:
55
56   condition = "${if and {\
57                         {!def:h_X-DSPAM-Check:}\
58                 }{1}{0}}"
59   headers_add = "X-DSPAM-Check: by $primary_hostname on $tod_full"
60
61
62DIRECTORY SETTINGS
63
64When changing the user/group it is highly advisable to set "home_directory"
65and "current_directory" to match the DSPAM home:
66
67home_directory = "/usr/local/var/dspam" # or /tmp
68current_directory = "/usr/local/var/dspam" # or /tmp
69
70Otherwise, the transport might try to run DSPAM in something like /home/bob
71under certain circumstances. This will most likely fail if DSPAM runs as
72"mail".
73
74PASS-THROUGH
75
76For a pass-through setup where DSPAM feeds all processed messages back to
77Exim it is also a good idea to set "prefix" and "suffix" to an empty
78string:
79  prefix = ""
80  suffix = ""
81
82ALIASES
83
84There is no need to create aliases for every user on the system in order to
85handle spam reports and false positives. They can be handled by directors
86and transports, using the following directors:
87
88   dspam_addspam:
89     prefix = spam-
90     driver = localuser
91     transport = addspam
92
93   dspam_falsepositive:
94     prefix = falsepos-
95     driver = localuser
96     transport = falsepositive
97
98For every $user on the system, these directors will handle messages
99addressed to "spam-$user@localhost" and "falsepos-$user@localhost", strip
100the prefix from the address, and pass the message to the respective
101transport. This requires two additional transports:
102
103addspam:
104  driver = pipe
105  command = "/path/to/dspam --user $local_part --class=spam --source=error"
106  return_path_add = false
107  return_fail_output = true
108  log_output = true
109  home_directory = "/path/to/dspam/dspam-home" # or "/tmp"
110  current_directory = "/path/to/dspam/dspam-home" # or "/tmp"
111  user = mail
112  group = mail
113  prefix = ""
114  suffix = ""
115falsepositive:
116  driver = pipe
117  command = "/path/to/dspam --user $local_part --class=innocent --source=error --deliver=innocent %u"
118  return_path_add = false
119  return_fail_output = true
120  log_output = true
121  home_directory = "/path/to/dspam-home" # or "/tmp"
122  current_directory = "/path/to/dspam-home" # or "/tmp"
123  user = mail
124  group = mail
125  prefix = ""
126  suffix = ""
127
128This way, all users are handled transparently. No fiddling with aliases is
129required as you add or remove users.
130
131
Note: See TracBrowser for help on using the repository browser.