aboutsummaryrefslogtreecommitdiffstats
path: root/doc/rspamc.1
blob: de022d5427f3a58f67e39674137fd36bf5375572 (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
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
.\" Automatically generated by Pandoc 3.1.11.1
.\"
.TH "RSPAMC" "1" "" "Rspamd User Manual" ""
.SH NAME
\f[CR]rspamc\f[R] \- rspamd command line client
.SH SYNOPSIS
rspamc [\f[I]options\f[R]] [\f[I]command\f[R]]
[\f[I]input\-file\f[R]]\&...
.PP
rspamc \[en]help
.SH DESCRIPTION
\f[CR]rspamc\f[R] is a simple rspamd client, primarily for classifying
or learning messages.
\f[CR]rspamc\f[R] supports the following commands:
.IP \[bu] 2
Scan commands:
.RS 2
.IP \[bu] 2
\f[CR]symbols\f[R]: scan message and show symbols (default command)
.RE
.IP \[bu] 2
Control commands
.RS 2
.IP \[bu] 2
\f[CR]learn_spam\f[R]: learn message as spam
.IP \[bu] 2
\f[CR]learn_ham\f[R]: learn message as ham
.IP \[bu] 2
\f[CR]fuzzy_add\f[R]: add message to fuzzy storage (check \f[CR]\-f\f[R]
and \f[CR]\-w\f[R] options for this command)
.IP \[bu] 2
\f[CR]fuzzy_del\f[R]: delete message from fuzzy storage (check
\f[CR]\-f\f[R] option for this command)
.IP \[bu] 2
\f[CR]stat\f[R]: show rspamd statistics
.IP \[bu] 2
\f[CR]stat_reset\f[R]: show and reset rspamd statistics (useful for
graphs)
.IP \[bu] 2
\f[CR]counters\f[R]: display rspamd symbols statistics
.IP \[bu] 2
\f[CR]uptime\f[R]: show rspamd uptime
.IP \[bu] 2
\f[CR]add_symbol\f[R]: add or modify symbol settings in rspamd
.IP \[bu] 2
\f[CR]add_action\f[R]: add or modify action settings
.RE
.PP
Control commands that modify rspamd state are considered privileged and
require a password to be specified with the \f[CR]\-P\f[R] option (see
\f[B]OPTIONS\f[R], below, for details).
.PD 0
.P
.PD
This depends on a controller\[cq]s settings and is discussed in the
\f[CR]rspamd\-workers\f[R] page (see \f[B]SEE ALSO\f[R], below, for
details).
.PP
\f[CR]Input files\f[R] may be either regular file(s) or a directory to
scan.
If no files are specified \f[CR]rspamc\f[R] reads from the standard
input.
Controller commands usually do not accept any input, however learn* and
fuzzy* commands requires input.
.SH OPTIONS
.TP
\-h \f[I]host[:port]\f[R], \-\-connect=\f[I]host[:port]\f[R]
Specify host and port
.TP
\-P \f[I]password\f[R], \-\-password=\f[I]password\f[R]
Specify control password
.TP
\-c \f[I]name\f[R], \-\-classifier=\f[I]name\f[R]
Classifier to learn spam or ham (bayes is used by default)
.TP
\-w \f[I]weight\f[R], \-\-weight=\f[I]weight\f[R]
Weight for fuzzy operations
.TP
\-f \f[I]number\f[R], \-\-flag=\f[I]number\f[R]
Flag for fuzzy operations
.TP
\-p, \-\-pass
Pass all filters
.TP
\-v, \-\-verbose
More verbose output
.TP
\-i \f[I]ip address\f[R], \-\-ip=\f[I]ip address\f[R]
Emulate that message was received from specified ip address
.TP
\-u \f[I]username\f[R], \-\-user=\f[I]username\f[R]
Emulate that message was received from specified authenticated user
.TP
\-d \f[I]user\[at]domain\f[R], \-\-deliver=\f[I]user\[at]domain\f[R]
Emulate that message was delivered to specified user (for
LDA/statistics)
.TP
\-F \f[I]user\[at]domain\f[R], \-\-from=\f[I]user\[at]domain\f[R]
Emulate that message has specified SMTP FROM address
.TP
\-r \f[I]user\[at]domain\f[R], \-\-rcpt=\f[I]user\[at]domain\f[R]
Emulate that message has specified SMTP RCPT address
.TP
\-\-helo=\f[I]helo_string\f[R]
Imitate SMTP HELO passing from MTA
.TP
\-\-hostname=\f[I]hostname\f[R]
Imitate hostname passing from MTA (rspamd assumes that it is verified by
MTA)
.TP
\-t \f[I]seconds\f[R], \-\-timeout=\f[I]seconds\f[R]
Timeout for waiting for a reply (can be floating point number,
e.g.\ 0.1)
.TP
\-b \f[I]host:port\f[R], \-\-bind=\f[I]host:port\f[R]
Bind to specified ip address
.TP
\-R, \-\-human
Output human readable report.
The first line of the output contains the message score and three
threshold scores, in this format:
.IP
.EX
    score/greylist/addheader/reject,action=N:ACTION,spam=0|1,skipped=0|1
.EE
.TP
\-j, \-\-json
Output formatted JSON
.TP
\-\-ucl
Output UCL
.TP
\-\-raw
Output raw data received from rspamd (compacted JSON)
.TP
\-\-headers
Output HTTP headers from a reply
.TP
\-\-extended\-urls
Output URLs in an extended format, showing full URL, host and the part
of host that was used by surbl module (if enabled).
.TP
\-n \f[I]parallel_count\f[R], \-\-max\-requests=\f[I]parallel_count\f[R]
Maximum number of requests to rspamd executed in parallel (8 by default)
.TP
\-e \f[I]command\f[R], \-\-execute=\f[I]command\f[R]
Execute the specified command with either mime output (if
\f[CR]mime\f[R] option is also specified) or formatted rspamd output
.TP
\-\-mime
Output the full mime message instead of scanning results only
.TP
\-\-header=\f[I]header\f[R]
Add custom HTTP header for a request.
You may specify header in format \f[CR]name=value\f[R] or just
\f[CR]name\f[R] for an empty header.
This option can be repeated multiple times.
.TP
\-\-sort=\f[I]type\f[R]
Sort output according to a specific field.
For \f[CR]counters\f[R] command the allowed values for this key are
\f[CR]name\f[R], \f[CR]weight\f[R], \f[CR]frequency\f[R] and
\f[CR]hits\f[R].
Appending \f[CR]:asc\f[R] to any of these types inverts sorting order.
.TP
\-\-commands
List available commands
.SH RETURN VALUE
On exit \f[CR]rspamc\f[R] returns \f[CR]0\f[R] if operation was
successful and an error code otherwise.
.SH EXAMPLES
Check stdin:
.IP
.EX
rspamc < some_file
.EE
.PP
Check files:
.IP
.EX
rspamc symbols file1 file2 file3
.EE
.PP
Learn files:
.IP
.EX
rspamc \-P pass learn_spam file1 file2 file3
.EE
.PP
Add fuzzy hash to set 2:
.IP
.EX
rspamc \-P pass \-f 2 \-w 10 fuzzy_add file1 file2
.EE
.PP
Delete fuzzy hash from other server:
.IP
.EX
rspamc \-P pass \-h hostname:11334 \-f 2 fuzzy_del file1 file2
.EE
.PP
Get statistics:
.IP
.EX
rspamc stat
.EE
.PP
Get uptime:
.IP
.EX
rspamc uptime
.EE
.PP
Add custom rule\[cq]s weight:
.IP
.EX
rspamc add_symbol test 1.5
.EE
.PP
Add custom action\[cq]s weight:
.IP
.EX
rspamc add_action reject 7.1
.EE
.SH SEE ALSO
Rspamd documentation and source code may be downloaded from \c
.UR https://rspamd.com/
.UE \c
\&.