File: spampd.html

package info (click to toggle)
spampd 2.53-1.1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 1,000 kB
  • sloc: perl: 6,687; sh: 280; makefile: 52
file content (517 lines) | stat: -rw-r--r-- 27,909 bytes parent folder | download | duplicates (3)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>

<body style="background-color: white">



<ul id="index">
  <li><a href="#NAME">NAME</a></li>
  <li><a href="#Synopsis">Synopsis</a></li>
  <li><a href="#Description">Description</a></li>
  <li><a href="#Requires">Requires</a></li>
  <li><a href="#Operation">Operation</a></li>
  <li><a href="#Upgrading">Upgrading</a></li>
  <li><a href="#Installation">Installation</a>
    <ul>
      <li><a href="#Postfix-specific-Notes">Postfix-specific Notes</a></li>
    </ul>
  </li>
  <li><a href="#Options">Options</a>
    <ul>
      <li><a href="#Deprecated-Options">Deprecated Options</a></li>
    </ul>
  </li>
  <li><a href="#Signals">Signals</a></li>
  <li><a href="#Examples">Examples</a></li>
  <li><a href="#Credits">Credits</a>
    <ul>
      <li><a href="#Code-Contributors-in-order-of-appearance">Code Contributors (in order of appearance):</a></li>
    </ul>
  </li>
  <li><a href="#Copyright-License-and-Disclaimer">Copyright, License, and Disclaimer</a></li>
  <li><a href="#Bugs">Bugs</a></li>
  <li><a href="#To-Do">To Do</a></li>
  <li><a href="#See-Also">See Also</a></li>
</ul>

<h1 id="NAME">NAME</h1>

<p>SpamPD - Spam Proxy Daemon (version 2.5x)</p>

<h1 id="Synopsis">Synopsis</h1>

<p><b>spampd</b> [<b>--host=host[:port]</b>] [<b>--relayhost=hostname[:port]</b>] [<b>--socket</b>] [<b>--socket-perms</b>] [<b>--relaysocket</b>] [<b>--user|u=username</b>] [<b>--group|g=groupname</b>] [<b>--children|c=n</b>] [<b>--maxrequests=n</b>] [<b>--childtimeout=n</b>] [<b>--satimeout=n</b>] [<b>--pid|p=filename</b>] [<b>--nodetach</b>] [<b>--setsid</b>] [<b>--logsock=inet|unix</b>] [<b>--maxsize=n</b>] [<b>--dose</b>] [<b>--tagall|a</b>] [<b>--log-rules-hit|rh</b>] [<b>--set-envelope-headers|seh</b>] [<b>--set-envelope-from|sef</b>] [<b>--auto-whitelist|aw</b>] [<b>--local-only|L</b>] [<b>--saconfig=filename</b>] [<b>--debug|d</b>]</p>

<p><b>spampd</b> <b>--help</b></p>

<h1 id="Description">Description</h1>

<p><i>spampd</i> is an SMTP/LMTP proxy that marks (or tags) spam using SpamAssassin (<a href="http://www.SpamAssassin.org/">http://www.SpamAssassin.org/</a>). The proxy is designed to be transparent to the sending and receiving mail servers and at no point takes responsibility for the message itself. If a failure occurs within <i>spampd</i> (or SpamAssassin) then the mail servers will disconnect and the sending server is still responsible for retrying the message for as long as it is configured to do so.</p>

<p><i>spampd</i> uses SpamAssassin to modify (tag) relayed messages based on their spam score, so all SA settings apply. This is described in the SA documentation. <i>spampd</i> will by default only tell SA to tag a message if it exceeds the spam threshold score, however you can have it rewrite all messages passing through by adding the --tagall option (see SA for how non-spam messages are tagged).</p>

<p><i>spampd</i> logs all aspects of its operation to syslog(8), using the mail syslog facility.</p>

<p>The latest version can be found at <a href="https://github.com/mpaperno/spampd">https://github.com/mpaperno/spampd</a>.</p>

<h1 id="Requires">Requires</h1>

<p>Perl modules:</p>

<dl>

<dt id="Mail::SpamAssassin"><b>Mail::SpamAssassin</b></dt>
<dd>

</dd>
<dt id="Net::Server::PreForkSimple"><b>Net::Server::PreForkSimple</b></dt>
<dd>

</dd>
<dt id="IO::File"><b>IO::File</b></dt>
<dd>

</dd>
<dt id="IO::Socket::IP"><b>IO::Socket::IP</b></dt>
<dd>

</dd>
<dt id="IO::Socket::UNIX"><b>IO::Socket::UNIX</b></dt>
<dd>

</dd>
<dt id="Time::HiRes-not-actually-required-but-recommended"><b>Time::HiRes</b> (not actually required but recommended)</dt>
<dd>

</dd>
</dl>

<h1 id="Operation">Operation</h1>

<p><i>spampd</i> is meant to operate as an S/LMTP mail proxy which passes each message through SpamAssassin for analysis. Note that <i>spampd</i> does not do anything other than check for spam, so it is not suitable as an anti-relay system. It is meant to work in conjunction with your regular mail system. Typically one would pipe any messages they wanted scanned through <i>spampd</i> after initial acceptance by your MX host. This is especially useful for using Postfix&#39;s (http://www.postfix.org) advanced content filtering mechanism, although certainly not limited to that application.</p>

<p>Please re-read the second sentence in the above paragraph. You should NOT enable <i>spampd</i> to listen on a public interface (IP address) unless you know exactly what you&#39;re doing! It is very easy to set up an open relay this way.</p>

<p>Here are some simple examples (square brackets in the &quot;diagrams&quot; indicate physical machines):</p>

<p><b>Running between firewall/gateway and internal mail server</b></p>

<ul>

<p>The firewall/gateway MTA would be configured to forward all of its mail to the port that <i>spampd</i> listens on, and <i>spampd</i> would relay its messages to port 25 of your internal server. <i>spampd</i> could either run on its own host (and listen on any port) or it could run on either mail server (and listen on any port except port 25).</p>

<pre><code><code> Internet -&gt; [ MX gateway (@inter.net.host:25) -&gt; 
        spampd (@localhost:2025) ] -&gt;
        Internal mail (@private.host.ip:25)</code></code></pre>

</ul>

<p><b>Using Postfix advanced content filtering</b></p>

<ul>

<p>Please see the <i>FILTER_README</i> that came with the Postfix distribution. You need to have a version of Postfix which supports this (ideally v.2 and up).</p>

<pre><code><code> Internet -&gt; [ Postfix (@inter.net.host:25) -&gt; 
        spampd (@localhost:10025) -&gt; 
        Postfix (@localhost:10026) ] -&gt; final delivery</code></code></pre>

</ul>

<p>Note that these examples only show incoming mail delivery. Since it is usually unnecessary to scan mail coming from your network (right?), it may be desirable to set up a separate outbound route which bypasses <i>spampd</i>.</p>

<h1 id="Upgrading">Upgrading</h1>

<p>If upgrading from a version prior to 2.2, please note that the --add-sc-header option is no longer supported. Use SAs built-in header manipulation features instead (as of SA v2.6).</p>

<p>Upgrading from version 1 simply involves replacing the <i>spampd</i> program file with the latest one. Note that the <i>dead-letters</i> folder is no longer being used and the --dead-letters option is no longer needed (though no errors are thrown if it&#39;s present). Check the <a href="#Options">&quot;Options&quot;</a> list below for a full list of new and deprecated options. Also be sure to check out the change log.</p>

<h1 id="Installation">Installation</h1>

<p><i>spampd</i> can be run directly from the command prompt if desired. This is useful for testing purposes, but for long term use you probably want to put it somewhere like /usr/bin or /usr/local/bin and execute it at system startup. For example on Red Hat-style Linux system one can use a script in /etc/rc.d/init.d to start <i>spampd</i> (a sample script is available on the <i>spampd</i> Web page @ http://www.WorldDesign.com/index.cfm/rd/mta/spampd.htm).</p>

<p>The options all have reasonable defaults, especially for a Postfix-centric installation. You may want to specify the --children option if you have an especially beefy or weak server box because <i>spampd</i> is a memory-hungry program. Check the <a href="#Options">&quot;Options&quot;</a> for details on this and all other parameters.</p>

<p>Note that <i>spampd</i> <b>replaces</b> <i>spamd</i> from the <i>SpamAssassin</i> distribution in function. You do not need to run <i>spamd</i> in order for <i>spampd</i> to work. This has apparently been the source of some confusion, so now you know.</p>

<h2 id="Postfix-specific-Notes">Postfix-specific Notes</h2>

<p>Here is a typical setup for Postfix &quot;advanced&quot; content filtering as described in the <i>FILTER_README</i> that came with the Postfix distribution (which you really need to read):</p>

<p><i>/etc/postfix/master.cf</i>:</p>

<pre><code><code> smtp   inet    n       -       y       -       -       smtpd
        -o content_filter=smtp:localhost:10025
        -o myhostname=mx.example.com

 localhost:10026        inet    n       -       n       -       10      smtpd
        -o content_filter=
        -o myhostname=mx-int.example.com</code></code></pre>

<p>The first entry is the main public-facing MTA which uses localhost:10025 as the content filter for all mail. The second entry receives mail from the content filter and does final delivery. Both smtpd instances use the same Postfix <i>main.cf</i> file. <i>spampd</i> is the process that listens on localhost:10025 and then connects to the Postfix listener on localhost:10026. Note that the <code><code>myhostname</code></code> options must be different between the two instances, otherwise Postfix will think it&#39;s talking to itself and abort sending.</p>

<p>For the above example you can simply start <i>spampd</i> like this:</p>

<pre><code><code> spampd --host=localhost:10025 --relayhost=localhost:10026</code></code></pre>

<p><i>FILTER_README</i> from the Postfix distro has more details and examples of various setups, including how to skip the content filter for outbound mail.</p>

<p>Another tip for Postfix when considering what timeout values to use for --childtimout and --satimeout options is the following command:</p>

<p><code><code><span class="comment"># postconf | grep timeout</span>
</code></code></p>

<p>This will return a list of useful timeout settings and their values. For explanations see the relevant <code><code>man</code></code> page (smtp, smtpd, lmtp). By default <i>spampd</i> is set up for the default Postfix timeout values.</p>

<h1 id="Options">Options</h1>

<dl>

<dt id="host-ip-hostname-:port"><b>--host=(ip|hostname)[:port]</b></dt>
<dd>

<p>Specifies what hostname/IP and port <i>spampd</i> listens on. By default, it listens on 127.0.0.1 (localhost) on port 10025.</p>

<p><b>Important!</b> You should NOT enable <i>spampd</i> to listen on a public interface (IP address) unless you know exactly what you&#39;re doing!</p>

</dd>
<dt id="port-n"><b>--port=n</b></dt>
<dd>

<p>Specifies what port <i>spampd</i> listens on. By default, it listens on port 10025. This is an alternate to using the above --host=ip:port notation.</p>

</dd>
<dt id="socket-socketpath"><b>--socket=socketpath</b></dt>
<dd>

<p>Specifies what UNIX socket <i>spampd</i> listens on. If this is specified, --host and --port are ignored.</p>

</dd>
<dt id="socket-perms-mode"><b>--socket-perms=mode</b></dt>
<dd>

<p>The file mode fo the created UNIX socket (see --socket) in octal format, e.g. 700 to specify acces only for the user spampd is run as.</p>

</dd>
<dt id="relayhost-ip-hostname-:port"><b>--relayhost=(ip|hostname)[:port]</b></dt>
<dd>

<p>Specifies the hostname/IP to which <i>spampd</i> will relay all messages. Defaults to 127.0.0.1 (localhost). If the port is not provided, that defaults to 25.</p>

</dd>
<dt id="relayport-n"><b>--relayport=n</b></dt>
<dd>

<p>Specifies what port <i>spampd</i> will relay to. Default is 25. This is an alternate to using the above --relayhost=ip:port notation.</p>

</dd>
<dt id="relaysocket-socketpath"><b>--relaysocket=socketpath</b></dt>
<dd>

<p>Specifies what UNIX socket spampd will relay to. If this is specified --relayhost and --relayport will be ignored.</p>

</dd>
<dt id="user-username-or--u-username"><b>--user=username</b> or <b>-u=username</b></dt>
<dd>

</dd>
<dt id="group-groupname-or--g-groupname"><b>--group=groupname</b> or <b>-g=groupname</b></dt>
<dd>

<p>Specifies the user and/or group that the proxy will run as. Default is <i>mail</i>/<i>mail</i>.</p>

</dd>
<dt id="children-n-or--c-n"><b>--children=n</b> or <b>-c=n</b></dt>
<dd>

<p>Number of child servers to start and maintain (where n &gt; 0). Each child will process up to --maxrequests (below) before exiting and being replaced by another child. Keep this number low on systems w/out a lot of memory. Default is 5 (which seems OK on a 512MB lightly loaded system). Note that there is always a parent process running, so if you specify 5 children you will actually have 6 <i>spampd</i> processes running.</p>

<p>You may want to set your origination mail server to limit the number of concurrent connections to <i>spampd</i> to match this setting (for Postfix this is the <code><code>xxxx_destination_concurrency_limit</code></code> setting where &#39;xxxx&#39; is the transport being used, usually &#39;smtp&#39;, and the default is 100).</p>

</dd>
<dt id="maxrequests-n"><b>--maxrequests=n</b></dt>
<dd>

<p><i>spampd</i> works by forking child servers to handle each message. The <b>maxrequests</b> parameter specifies how many requests will be handled before the child exits. Since a child never gives back memory, a large message can cause it to become quite bloated; the only way to reclaim the memory is for the child to exit. The default is 20.</p>

</dd>
<dt id="childtimeout-n"><b>--childtimeout=n</b></dt>
<dd>

<p>This is the number of seconds to allow each child server before it times out a transaction. In an S/LMTP transaction the timer is reset for every command. This timeout includes time it would take to send the message data, so it should not be too short. Note that it&#39;s more likely the origination or destination mail servers will timeout first, which is fine. This is just a &quot;sane&quot; failsafe. Default is 360 seconds (6 minutes).</p>

</dd>
<dt id="satimeout-n"><b>--satimeout=n</b></dt>
<dd>

<p>This is the number of seconds to allow for processing a message with SpamAssassin (including feeding it the message, analyzing it, and adding the headers/report if necessary). This should be less than your origination and destination servers&#39; timeout settings for the DATA command. For Postfix the default is 300 seconds in both cases (smtp_data_done_timeout and smtpd_timeout). In the event of timeout while processing the message, the problem is logged and the message is passed on anyway (w/out spam tagging, obviously). To fail the message with a temp 450 error, see the --dose (die-on-sa-errors) option, below. Default is 285 seconds.</p>

</dd>
<dt id="pid-filename-or--p-filename"><b>--pid=filename</b> or <b>-p=filename</b></dt>
<dd>

<p>Specifies a filename where <i>spampd</i> will write its process ID so that it is easy to kill it later. The directory that will contain this file must be writable by the <i>spampd</i> user. The default is <i>/var/run/spampd.pid</i>.</p>

</dd>
<dt id="logsock-unix-inet-new-in-v2.20"><b>--logsock=(unix|inet)</b> <code><code>(new in v2.20)</code></code></dt>
<dd>

<p>Syslog socket to use. May be either &quot;unix&quot; of &quot;inet&quot;. Default is &quot;unix&quot; except on HP-UX and SunOS (Solaris) systems which seem to prefer &quot;inet&quot;.</p>

</dd>
<dt id="nodetach-new-in-v2.20"><b>--nodetach</b> <code><code>(new in v2.20)</code></code></dt>
<dd>

<p>If this option is given spampd won&#39;t detach from the console and fork into the background. This can be useful for running under control of some daemon management tools or when configured as a win32 service under cygrunsrv&#39;s control.</p>

</dd>
<dt id="setsid-new-in-v2.51"><b>--setsid</b> <code><code>(new in v2.51)</code></code></dt>
<dd>

<p>If this option is given spampd will fork after the bind method to release itself from the command line and then run the POSIX::setsid() command to truly daemonize. Only used if --nodetach isn&#39;t specified.</p>

</dd>
<dt id="maxsize-n"><b>--maxsize=n</b></dt>
<dd>

<p>The maximum message size to send to SpamAssassin, in KBytes. By default messages over 64KB are not scanned at all, and an appropriate message is logged indicating this. The size includes headers and attachments (if any).</p>

</dd>
<dt id="dose"><b>--dose</b></dt>
<dd>

<p>Acronym for (d)ie (o)n (s)pamAssassin (e)rrors. By default if <i>spampd</i> encounters a problem with processing the message through Spam Assassin (timeout or other error), it will still pass the mail on to the destination server. If you specify this option however, the mail is instead rejected with a temporary error (code 450, which means the origination server should keep retrying to send it). See the related --satimeout option, above.</p>

</dd>
<dt id="tagall-or--a"><b>--tagall</b> or <b>-a</b></dt>
<dd>

<p>Tells <i>spampd</i> to have SpamAssassin add headers to all scanned mail, not just spam. By default <i>spampd</i> will only rewrite messages which exceed the spam threshold score (as defined in the SA settings). Note that for this option to work as of SA-2.50, the <i>always_add_report</i> and/or <i>always_add_headers</i> settings in your SpamAssassin <i>local.cf</i> need to be set to 1/true.</p>

</dd>
<dt id="log-rules-hit-or---rh"><b>--log-rules-hit</b> or <b>--rh</b></dt>
<dd>

<p>Logs the names of each SpamAssassin rule which matched the message being processed. This list is returned by SA.</p>

</dd>
<dt id="set-envelope-headers-or---seh-new-in-v2.30"><b>--set-envelope-headers</b> or <b>--seh</b> <code><code>(new in v2.30)</code></code></dt>
<dd>

<p>Turns on addition of X-Envelope-To and X-Envelope-From headers to the mail being scanned before it is passed to SpamAssassin. The idea is to help SA process any blacklist/whitelist to/from directives on the actual sender/recipients instead of the possibly bogus envelope headers. This potentially exposes the list of all recipients of that mail (even BCC&#39;ed ones). Therefore usage of this option is discouraged.</p>

<p><i>NOTE</i>: Even though spampd tries to prevent this leakage by removing the X-Envelope-To header after scanning, SpamAssassin itself might add headers itself which report one or more of the recipients which had been listed in this header.</p>

</dd>
<dt id="set-envelope-from-or---sef-new-in-v2.30"><b>--set-envelope-from</b> or <b>--sef</b> <code><code>(new in v2.30)</code></code></dt>
<dd>

<p>Same as above option but only enables the addition of X-Envelope-From header. For those that don&#39;t feel comfortable with the possible information exposure of X-Envelope-To. The above option overrides this one.</p>

</dd>
<dt id="auto-whitelist-or---aw-deprecated-with-SpamAssassin-v3"><b>--auto-whitelist</b> or <b>--aw</b> <code><code>(deprecated with SpamAssassin v3+)</code></code></dt>
<dd>

<p>This option is no longer relevant with SA version 3.0 and above, which controls auto whitelist use via config file settings. This option is likely to be removed in the future. Do not use it unless you must use an older SA version.</p>

<p>For SA version &lt; 3.0, turns on the SpamAssassin global whitelist feature. See the SA docs. Note that per-user whitelists are not available.</p>

<p><b>NOTE</b>: <b>DBBasedAddrList</b> is used as the storage mechanism. If you wish to use a different mechanism (such as SQLBasedAddrList), the <i>spampd</i> code will need to be modified in 2 instances (search the source for DBBasedAddrList).</p>

</dd>
<dt id="local-only-or--L"><b>--local-only</b> or <b>-L</b></dt>
<dd>

<p>Turn off all SA network-based tests (DNS, Razor, etc).</p>

</dd>
<dt id="homedir-directory"><b>--homedir=directory</b></dt>
<dd>

<p>Use the specified directory as home directory for the spamassassin process. Things like the auto-whitelist and other plugin (razor/pyzor) files get written to here. Defaul is /var/spool/spamassassin/spampd. A good place for this is in the same place your bayes_path SA config setting points to (if any). Make sure this directory is accessible to the user that spampd is running as (default: mail). New in v2.40. Thanks to Alexander Wirt for this fix.</p>

</dd>
<dt id="saconfig-filename"><b>--saconfig=filename</b></dt>
<dd>

<p>Use the specified file for SpamAssassin configuration options in addition to the default local.cf file. Any options specified here will override the same option from local.cf. Default is to not use any additional configuration file.</p>

</dd>
<dt id="debug-or--d"><b>--debug</b> or <b>-d</b></dt>
<dd>

<p>Turns on SpamAssassin debug messages which print to the system mail log (same log as spampd will log to). Also turns on more verbose logging of what spampd is doing (new in v2). Also increases log level of Net::Server to 4 (debug), adding yet more info (but not too much) (new in v2.2).</p>

</dd>
<dt id="version"><b>--version</b></dt>
<dd>

<p>Prints version information about SpamPD, Net::Server, SpamAssassin, and Perl.</p>

</dd>
<dt id="help-or--h-or"><b>--help</b> or <b>-h</b> or <b>-?</b></dt>
<dd>

<p>Prints usage information.</p>

</dd>
</dl>

<h2 id="Deprecated-Options">Deprecated Options</h2>

<p>The following options are no longer used but still accepted for backwards compatibility with prevoius <i>spampd</i> versions:</p>

<dl>

<dt id="dead-letters"><b>--dead-letters</b></dt>
<dd>

</dd>
<dt id="heloname"><b>--heloname</b></dt>
<dd>

</dd>
<dt id="stop-at-threshold"><b>--stop-at-threshold</b></dt>
<dd>

</dd>
<dt id="add-sc-header"><b>--add-sc-header</b></dt>
<dd>

</dd>
<dt id="hostname"><b>--hostname</b></dt>
<dd>

</dd>
</dl>

<h1 id="Signals">Signals</h1>

<dl>

<dt id="HUP">HUP</dt>
<dd>

<p>Sending HUP signal to the master process will restart all the children gracefully (meaning the currently running requests will shut down once the request is complete). SpamAssassin configuration is NOT reloaded.</p>

</dd>
<dt id="TTIN-TTOU">TTIN, TTOU</dt>
<dd>

<p>Sending TTIN signal to the master process will dynamically increase the number of children by one, and TTOU signal will decrease it by one.</p>

</dd>
<dt id="INT-TERM">INT, TERM</dt>
<dd>

<p>Sending INT or TERM signal to the master process will kill all the children immediately and shut down the daemon.</p>

</dd>
</dl>

<h1 id="Examples">Examples</h1>

<dl>

<dt id="Running-between-firewall-gateway-and-internal-mail-server">Running between firewall/gateway and internal mail server:</dt>
<dd>

<p><i>spampd</i> listens on port 10025 on the same host as the internal mail server.</p>

<pre><code><code>  spampd --host=192.168.1.10</code></code></pre>

<p>Same as above but <i>spampd</i> runs on port 10025 of the same host as the firewall/gateway and passes messages on to the internal mail server on another host.</p>

<pre><code><code>  spampd --relayhost=192.168.1.10</code></code></pre>

</dd>
<dt id="Using-Postfix-advanced-content-filtering-example-and-disable-SA-network-checks">Using Postfix advanced content filtering example and disable SA network checks:</dt>
<dd>

<pre><code><code>  spampd --port=10025 --relayhost=127.0.0.1:10026 --local-only</code></code></pre>

</dd>
<dt id="Using-UNIX-sockets-instead-if-INET-ports">Using UNIX sockets instead if INET ports:</dt>
<dd>

<p>Spampd listens on the UNIX socket /var/run/spampd.socket with persmissions 700 instead of a TCP port:</p>

<pre><code><code>  spampd --socket /var/run/spampd.socket --socket-perms 700</code></code></pre>

<p>Spampd will relay mail to /var/run/dovecot/lmtp instead of a TCP port:</p>

<pre><code><code>  spampd --relaysocket /var/run/dovecot/lmtp</code></code></pre>

<p>Remember that the user spampd runs as needs to have read AND write permissions on the relaysocket!</p>

</dd>
</dl>

<h1 id="Credits">Credits</h1>

<p><i>spampd</i> is written and maintained by Maxim Paperno &lt;MPaperno@WorldDesign.com&gt;. See <a href="http://www.WorldDesign.com/index.cfm/rd/mta/spampd.htm">http://www.WorldDesign.com/index.cfm/rd/mta/spampd.htm</a> for latest info.</p>

<p><i>spampd</i> v2 uses two Perl modules by Bennett Todd and Copyright (C) 2001 Morgan Stanley Dean Witter. These are distributed under the GNU GPL (see module code for more details). Both modules have been slightly modified from the originals and are included in this file under new names.</p>

<p>Also thanks to Bennett Todd for the example smtpproxy script which helped create this version of <i>spampd</i>. See http://bent.latency.net/smtpprox/ .</p>

<p><i>spampd</i> v1 was based on code by Dave Carrigan named <i>assassind</i>. Trace amounts of his code or documentation may still remain. Thanks to him for the original inspiration and code. <a href="https://openshut.net/">https://openshut.net/</a>.</p>

<p>Also thanks to <i>spamd</i> (included with SpamAssassin) and <i>amavisd-new</i> (<a href="http://www.ijs.si/software/amavisd/">http://www.ijs.si/software/amavisd/</a>) for some tricks.</p>

<p>Various people have contributed patches, bug reports, and ideas, all of whom I would like to thank. I have tried to include credits in code comments and in the change log, as appropriate.</p>

<h2 id="Code-Contributors-in-order-of-appearance">Code Contributors (in order of appearance):</h2>

<pre><code><code> Kurt Andersen
 Roland Koeckel
 Urban Petry
 Sven Mueller</code></code></pre>

<p>See also: <a href="https://github.com/mpaperno/spampd/graphs/contributors/">https://github.com/mpaperno/spampd/graphs/contributors/</a></p>

<h1 id="Copyright-License-and-Disclaimer">Copyright, License, and Disclaimer</h1>

<p><i>spampd</i> is Copyright (c) 2002-2006, 2009, 2010, 2013, 2018 by World Design Group, Inc. and Maxim Paperno.</p>

<p>Portions are Copyright (c) 2001 Morgan Stanley Dean Witter as mentioned above in the Credits section.</p>

<pre><code><code>    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.</code></code></pre>

<p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>.</p>

<h1 id="Bugs">Bugs</h1>

<p>Use GitHub issue tracking: <a href="https://github.com/mpaperno/spampd/issues">https://github.com/mpaperno/spampd/issues</a></p>

<h1 id="To-Do">To Do</h1>

<p>Figure out how to use Net::Server::PreFork because it has cool potential for load management. I tried but either I&#39;m missing something or PreFork is somewhat broken in how it works. If anyone has experience here, please let me know.</p>

<p>Add configurable option for rejecting mail outright based on spam score. It would be nice to make this program safe enough to sit in front of a mail server such as Postfix and be able to reject mail before it enters our systems. The only real problem is that Postfix will see localhost as the connecting client, so that disables any client-based checks Postfix can do and creates a possible relay hole if localhost is trusted.</p>

<h1 id="See-Also">See Also</h1>

<p>perl(1), Spam::Assassin(3), <a href="http://www.spamassassin.org/">http://www.spamassassin.org/</a>, <a href="http://www.WorldDesign.com/index.cfm/rd/mta/spampd.htm">http://www.WorldDesign.com/index.cfm/rd/mta/spampd.htm</a></p>


</body>

</html>