]> git.donarmstrong.com Git - deb_pkgs/spamass-milter.git/blob - debian/README.Debian
don't bother to rm/chmod/chown inet sockets
[deb_pkgs/spamass-milter.git] / debian / README.Debian
1 --------------------------------------------------------------
2   Integrating spamass-milter into your sendmail installation
3 --------------------------------------------------------------
4
5 You will need to edit /etc/mail/sendmail.mc and add an
6 INPUT_MAIL_FILTER line that connects to the spamass-milter socket.
7
8 By default the spamass-milter socket is
9 /var/run/spamass/spamass.sock; so your INPUT_MAIL_FILTER should look
10 something like:
11
12  # spamassassin settings
13  INPUT_MAIL_FILTER(`spamassassin',
14          `S=local:/var/run/spamass/spamass.sock, F=,
15          T=S:4m;R:4m;E:10m')dnl
16  define(`confMILTER_MACROS_CONNECT',`t, b, j, _, {daemon_name}, {if_name}, {if_addr}')dnl
17  define(`confMILTER_MACROS_HELO',`s, {tls_version}, {cipher}, {cipher_bits}, {cert_subject}, {cert_issuer}')dnl
18  define(`confMILTER_MACROS_ENVRCPT',`b, i, j, r, v, Z, _')dnl
19
20 Briefly, the F=, tells sendmail to just pass the connection through if
21 the milter fails. This is most likely the setting you want. If you
22 want to temporarily fail a connection, you can set F=T. You almost
23 definitely don't want to reject connections, but if necessary, you can
24 do that by setting F=R.
25
26 You may also need to adjust these timeout settings, as spamd can be
27 sluggish on a slow machine. S is the timeout for sending information
28 from the MTA to a filter. R is the timeout for reading a reply from
29 the filter. E is the overall timeout between sending end-of-message to
30 filter and waiting for the final acknowledgment.
31
32 The settings above seem to work well on a Celeron 466 that receives
33 around 1000 emails an hour. You may wish to adjust them according to
34 your needs.
35
36 See http://www.sendmail.com/partner/resources/development/milter_api/installation.html
37 and http://www.sendmail.org/m4/adding_mailfilters.html#INPUT_MAIL_FILTER
38 for more information on milters.
39
40 If you are using the alias expansion method, -x, you will need to add
41 spamass-milter to the smmsp group using:
42
43  adduser spamass-milter smmsp;
44
45 This does not need to be done unless you are using alias expansion.
46
47 --------------------------------------------------------------
48   Integrating spamass-milter into your postfix installation
49 --------------------------------------------------------------
50
51 You need to edit /etc/postfix/main.cf and configure smptpd_milters so
52 that postfix connects to the spamass-milter socket. Something like:
53
54   # spamass-milter configuration
55   smtpd_milters = unix:/var/spool/postfix/spamass/spamass.sock
56
57 should work. Note, however, if you're using a chrooted version of
58 postfix, you'll need the local path to the socket inside of the
59 chroot. In recent versions of Debian the following should work:
60
61   # spamass-milter configuration
62   smtpd_milters = unix:/spamass/spamass.sock
63   # milter macros useful for spamass-milter
64   milter_connect_macros = j {daemon_name} v {if_name} _
65   milter_data_macros = j i {auth_type} {daemon_name} v {if_name} _
66   milter_rcpt_macros = j {auth_type} {daemon_name} v {if_name} _
67
68 See http://www.postfix.org/MILTER_README.html or
69 /usr/share/doc/postfix/MILTER_README.gz (in postfix-doc) for
70 information on how to set tempfail and the various timeouts that the
71 sendmail configuration above uses.
72
73 The defaults for spamass-milter adjust themselves so that no
74 configuration in /etc/default/spamass-milter should be required.
75 [However, if you are not doing so, see below.]
76
77 -------------------------------------------------------------
78   Adjusting how spamass-milter is started
79 -------------------------------------------------------------
80
81 You can adjust how spamass-milter starts, and the options it calls
82 spamc with by adjusting /etc/default/spamass-milter. OPTIONS is passed
83 directly to spamass-milter by /etc/init.d/spamass-milter. [Refer to
84 spamass-milter(1) for details.]
85
86 Other settings which may be of use:
87
88 SOCKET sets the location of the socket; defaults to
89 /var/run/spamass/spamass.sock unless you are running postfix, where it
90 is set to /var/spool/postfix/spamass/spamass.sock.
91
92 SOCKETOWNER is the owner of the socket, which defaults to root:root or
93 postfix:postfix if you're running postfix.
94
95 SOCKETMODE is the mode of the socket, which defaults to 0600 or 0660
96 if you're running postfix.
97
98 RUNAS controls the user which spamass-milter runs as; defaults to
99 spamass-milter.
100
101 If you want to use an inet socket for spamass-milter (like inet:9999
102 or inet:9999@127.0.0.1), then you'll need to make the following
103 configuration changes in /etc/default/spamass-milter:
104
105 SOCKET="inet:9999@127.0.0.1"
106 SOCKETMODE=""
107 SOCKETOWNER=""
108
109 -------------------------------------------------------------
110 Debugging spamass-milter
111 -------------------------------------------------------------
112
113 As spamass-milter is still undergoing development, you may see bugs
114 from time to time.
115
116 If spamass-milter is segfaulting (SEGV or SIG 11) please build a
117 debugging version of the spamass-milter package and install it:
118
119 mkdir temp;
120 cd temp;
121 apt-get source spamass-milter;
122 apt-get build-dep spamass-milter;
123 cd spamass-milter-*;
124 DEB_BUILD_OPTIONS='nostrip' CXXFLAGS='-O0 -g' fakeroot debian/rules clean binary;
125 dpkg -i spamass-milter*.deb;
126
127 Then turn on coredumps (ulimit -c unlimited), and start spamass-milter
128 as usual (/etc/init.d/spamass-milter start).
129
130 When spamass-milter cores, run gdb on the core, ala:
131 gdb /usr/sbin/spamass-milter /foo/corefile.pid
132 thread apply all where
133 bt
134 q
135
136 and send the results along with your bug report using reportbug.
137
138  -- Don Armstrong <don@debian.org>, Thu, 10 May 2018 11:15:25 -0700