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
|
.TH RSPAMC 1 "" "Rspamd User Manual"
.SH NAME
.PP
rspamc - rspamd command line client
.SH SYNOPSIS
.PP
rspamc [\f[I]options\f[]] [\f[I]command\f[]] [\f[I]input-file\f[]]...
.PP
rspamc --help
.SH DESCRIPTION
.PP
Rspamc is a simple client for checking messages using rspamd or for
learning rspamd by messages.
Rspamc supports the following commands:
.IP \[bu] 2
Scan commands:
.RS 2
.IP \[bu] 2
\f[I]symbols\f[]: scan message and show symbols (default command)
.RE
.IP \[bu] 2
Control commands
.RS 2
.IP \[bu] 2
\f[I]learn_spam\f[]: learn message as spam
.IP \[bu] 2
\f[I]learn_ham\f[]: learn message as ham
.IP \[bu] 2
\f[I]fuzzy_add\f[]: add message to fuzzy storage (check \f[C]-f\f[] and
\f[C]-w\f[] options for this command)
.IP \[bu] 2
\f[I]fuzzy_del\f[]: delete message from fuzzy storage (check \f[C]-f\f[]
option for this command)
.IP \[bu] 2
\f[I]stat\f[]: show rspamd statistics
.IP \[bu] 2
\f[I]stat_reset\f[]: show and reset rspamd statistics (useful for
graphs)
.IP \[bu] 2
\f[I]counters\f[]: display rspamd symbols statistics
.IP \[bu] 2
\f[I]uptime\f[]: show rspamd uptime
.IP \[bu] 2
\f[I]add_symbol\f[]: add or modify symbol settings in rspamd
.IP \[bu] 2
\f[I]add_action\f[]: add or modify action settings
.RE
.PP
Control commands that modifies rspamd state are considered as privileged
and basically requires a password to be specified with \f[C]-P\f[]
option (see \f[B]OPTIONS\f[], below, for details).
This depends on a controller\[aq]s settings and is discussed in
\f[C]rspamd-workers\f[] page.
.PP
\f[C]Input\ files\f[] may be either regular file(s) or a directory to
scan.
If no files are specified rspamc reads from the standard input.
Controller commands usually does not accept any input, however learn*
and fuzzy* commands requires input.
.SH OPTIONS
.PP
-h \f[I]host[:port]\f[], --connect=\f[I]host[:port]\f[] Specify host and
port
.PP
-P \f[I]password\f[], --password=\f[I]password\f[] Specify control
password
.TP
.B -c \f[I]name\f[], --classifier=\f[I]name\f[]
Classifier to learn spam or ham (bayes is used by default)
.RS
.RE
.TP
.B -w \f[I]weight\f[], --weight=\f[I]weight\f[]
Weight for fuzzy operations
.RS
.RE
.TP
.B -f \f[I]number\f[], --flag=\f[I]number\f[]
Flag for fuzzy operations
.RS
.RE
.TP
.B -p, --pass
Pass all filters
.RS
.RE
.TP
.B -v, --verbose
More verbose output
.RS
.RE
.TP
.B -i \f[I]ip address\f[], --ip=\f[I]ip address\f[]
Emulate that message was received from specified ip address
.RS
.RE
.TP
.B -u \f[I]username\f[], --user=\f[I]username\f[]
Emulate that message was from specified user
.RS
.RE
.TP
.B -d \f[I]user\@domain\f[], --deliver=\f[I]user\@domain\f[]
Emulate that message is delivered to specified user
.RS
.RE
.TP
.B -F \f[I]user\@domain\f[], --from=\f[I]user\@domain\f[]
Emulate that message is from specified user
.RS
.RE
.TP
.B -r \f[I]user\@domain\f[], --rcpt=\f[I]user\@domain\f[]
Emulate that message is for specified user
.RS
.RE
.TP
.B --helo=\f[I]helo_string\f[]
Imitate SMTP HELO passing from MTA
.RS
.RE
.TP
.B --hostname=\f[I]hostname\f[]
Imitate hostname passing from MTA (rspamd assumes that it is verified by
MTA)
.RS
.RE
.TP
.B -t \f[I]seconds\f[], --timeout=\f[I]seconds\f[]
Timeout for waiting for a reply
.RS
.RE
.TP
.B -b \f[I]host:port\f[], --bind=\f[I]host:port\f[]
Bind to specified ip address
.RS
.RE
.TP
.B --commands
List available commands
.RS
.RE
.SH RETURN VALUE
.PP
On exit rspamc returns \f[C]0\f[] if operation was successfull and an
error code otherwise.
.SH EXAMPLES
.PP
Check stdin:
.IP
.nf
\f[C]
rspamc\ <\ some_file
\f[]
.fi
.PP
Check files:
.IP
.nf
\f[C]
rspamc\ symbols\ file1\ file2\ file3
\f[]
.fi
.PP
Learn files:
.IP
.nf
\f[C]
rspamc\ -P\ pass\ learn_spam\ file1\ file2\ file3
\f[]
.fi
.PP
Add fuzzy hash to set 2:
.IP
.nf
\f[C]
rspamc\ -P\ pass\ -f\ 2\ -w\ 10\ fuzzy_add\ file1\ file2
\f[]
.fi
.PP
Delete fuzzy hash from other server:
.IP
.nf
\f[C]
rspamc\ -P\ pass\ -h\ hostname:11334\ -f\ 2\ fuzzy_del\ file1\ file2
\f[]
.fi
.PP
Get statistics:
.IP
.nf
\f[C]
rspamc\ stat
\f[]
.fi
.PP
Get uptime:
.IP
.nf
\f[C]
rspamc\ uptime
\f[]
.fi
.PP
Add custom rule\[aq]s weight:
.IP
.nf
\f[C]
rspamc\ add_symbol\ test\ 1.5
\f[]
.fi
.PP
Add custom action\[aq]s weight:
.IP
.nf
\f[C]
rspamc\ add_action\ reject\ 7.1
\f[]
.fi
.SH SEE ALSO
.PP
Rspamd documentation and source codes may be downloaded from
<https://rspamd.com/>.
|