summaryrefslogtreecommitdiff
path: root/libexec/spamd/spamd-setup.8
blob: 042c10f7c49a1b1cfa7d5c1e402f4b91a79d11c0 (plain)
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
.\"	$OpenBSD: spamd-setup.8,v 1.5 2003/03/02 20:32:05 deraadt Exp $
.\"
.\" Copyright (c) 2003 Jason L. Wright (jason@thought.net)
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"      This product includes software developed by Jason L. Wright
.\" 4. The name of the author may not be used to endorse or promote products
.\"    derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
.\" DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd Febuary 14, 2003
.Dt spamd-setup 8
.Os
.Sh NAME
.Nm spamd-setup
.Nd parse and load file of spammer addresses
.Sh SYNOPSIS
.Nm spamd-setup
.Op Fl c
.Op Fl s
.Op Fl s
.Op Fl 1
.Op Fl 2
.Op Fl f Ar file
.Op Fl w Ar file
.Op Ar file ...
.Sh DESCRIPTION
The
.Nm
utility adds blacklists by adding addresses to the
.Xr pf 4
table
.Aq spamd ,
as well as configuring mail rejection messages for
the added list of addresses in
.Xr spamd 8 .
The
.Aq spamd
table is used in conjuction with a
.Xr pf 4
redirection rule can be used to selectively redirect mail connections
to the
.Xr spamd 8 .
daemon .
Sources and actions are as follows:
.Bl -tag -width XXXXXXXXXX
.It Fl s
The SPEWS level 1 database is fetched via
.Xr ftp 1
and used in a blacklist named
.Li spews-1
.It Fl 1
Synonym for
.Fl s .
.It Fl 2
The SPEWS level 2 database is fetched via
.Xr ftp 1
and used in a blacklist named
.Li spews-2
.It Fl c
The chinese netblock datbase is fetched via
.Xr ftp 1
and used in a blacklist named
.Li china
.It Fl k
The korean netblock database is fetched via
.Xr ftp 1
and used in a blacklist named
.Li korea
.It Fl f Ar file
The local file specified is used in a black-list named
.Li local
.It Fl w Ar file
The local file specified is added to the white-list.
.El
.Pp
The arguments are processed in the order they are given and the resulting
output is concatenated to build up a table for
.Xr pf 4 .
First, all of the addresses from the black-list are added.
Then, all of the addresses from the white-list are removed.
Then, the blacklist address, are sent to a running
.Xr spamd 8
along with the message spamd will give on mail rejection when
a matching client connects.
The input file is expected to consist of one network block or address
 per line (optionally followed by a space and text that is ignored).
Comment lines beginning with
.Li #
are ignored.
Network blocks may be specified in any of the formats as in
the following example:
.Bd -literal -offset indent
.Ic # CIDR format
.Ic 192.168.20.0/24
.Ic # A start - end range
.Ic 192.168.21.0 - 192.168.21.255
.Ic # A masked address
.Ic 192.168.22.0:255.255.255.0
.Ic # As a single IP address
.Ic 192.168.23.1
.Ed
.Sh BLACKLIST FILES
additional files given as parameters to
.Nm
will be read to configure blacklists. The blacklist file format is
as follows.
.Bd -literal -offset indent
.Ic SPAMD_SOURCE;mylist;"Sorry %A, You are a probably spammer\enBye\en"
.Ic file:/usr/local/share/spammers.txt
.Ic http://www.somewhere.org/bigspamblocks.txt
.Ic SPAMD_SOURCE_REMOVE
.Ic file:/usr/local/share/notspammers.txt
.Ic file://www.somewhereelse.org/notspamblocks.txt
.Ic SPAMD_SOURCE;mykorealist;"Your address %A, appears to be from korea"
.Ic http://www.okean.com/koreacidr.txt
.Ic SPAMD_SOURCE_REMOVE
.Ic file:/usr/local/share/taekwondopals
.Ed
.Pp
The
.Li SPAMD_SOURCE
line includes a tag to name the blacklist, and the message to be
given to any connections that match this list. the message must
be enclosed in double quotes
and may include \en to produce a newline in the output. \e\" will produce
a double quote in the output, and %% will produce a single % in the output.
%A will be expanded by
.Xr spamd 8
to display the connecting IP address in the output.
.Pp
Following the
.Li SPAMD_SOURCE
should be URL's, one per line, from which to fetch the
network blocks to blacklist.
Following the
.Li SPAMD_SOURCE_REMOVE
line may be further URL's, one per line, from which to
fetch network blocks that will be removed from this blacklist.
.Sh SEE ALSO
.Xr ftp 1 ,
.Xr pf 4 ,
.Xr spamd 8