| 1 |
.\" Automatically generated by Pandoc 3.1.11.1 |
| 2 |
.\" |
| 3 |
.TH "RSPAMC" "1" "" "Rspamd User Manual" "" |
| 4 |
.SH NAME |
| 5 |
\f[CR]rspamc\f[R] \- rspamd command line client |
| 6 |
.SH SYNOPSIS |
| 7 |
rspamc [\f[I]options\f[R]] [\f[I]command\f[R]] |
| 8 |
[\f[I]input\-file\f[R]]\&... |
| 9 |
.PP |
| 10 |
rspamc \[en]help |
| 11 |
.SH DESCRIPTION |
| 12 |
\f[CR]rspamc\f[R] is a simple rspamd client, primarily for classifying |
| 13 |
or learning messages. |
| 14 |
\f[CR]rspamc\f[R] supports the following commands: |
| 15 |
.IP \[bu] 2 |
| 16 |
Scan commands: |
| 17 |
.RS 2 |
| 18 |
.IP \[bu] 2 |
| 19 |
\f[CR]symbols\f[R]: scan message and show symbols (default command) |
| 20 |
.RE |
| 21 |
.IP \[bu] 2 |
| 22 |
Control commands |
| 23 |
.RS 2 |
| 24 |
.IP \[bu] 2 |
| 25 |
\f[CR]learn_spam\f[R]: learn message as spam |
| 26 |
.IP \[bu] 2 |
| 27 |
\f[CR]learn_ham\f[R]: learn message as ham |
| 28 |
.IP \[bu] 2 |
| 29 |
\f[CR]fuzzy_add\f[R]: add message to fuzzy storage (check \f[CR]\-f\f[R] |
| 30 |
and \f[CR]\-w\f[R] options for this command) |
| 31 |
.IP \[bu] 2 |
| 32 |
\f[CR]fuzzy_del\f[R]: delete message from fuzzy storage (check |
| 33 |
\f[CR]\-f\f[R] option for this command) |
| 34 |
.IP \[bu] 2 |
| 35 |
\f[CR]stat\f[R]: show rspamd statistics |
| 36 |
.IP \[bu] 2 |
| 37 |
\f[CR]stat_reset\f[R]: show and reset rspamd statistics (useful for |
| 38 |
graphs) |
| 39 |
.IP \[bu] 2 |
| 40 |
\f[CR]counters\f[R]: display rspamd symbols statistics |
| 41 |
.IP \[bu] 2 |
| 42 |
\f[CR]uptime\f[R]: show rspamd uptime |
| 43 |
.IP \[bu] 2 |
| 44 |
\f[CR]add_symbol\f[R]: add or modify symbol settings in rspamd |
| 45 |
.IP \[bu] 2 |
| 46 |
\f[CR]add_action\f[R]: add or modify action settings |
| 47 |
.RE |
| 48 |
.PP |
| 49 |
Control commands that modify rspamd state are considered privileged and |
| 50 |
require a password to be specified with the \f[CR]\-P\f[R] option (see |
| 51 |
\f[B]OPTIONS\f[R], below, for details). |
| 52 |
.PD 0 |
| 53 |
.P |
| 54 |
.PD |
| 55 |
This depends on a controller\[cq]s settings and is discussed in the |
| 56 |
\f[CR]rspamd\-workers\f[R] page (see \f[B]SEE ALSO\f[R], below, for |
| 57 |
details). |
| 58 |
.PP |
| 59 |
\f[CR]Input files\f[R] may be either regular file(s) or a directory to |
| 60 |
scan. |
| 61 |
If no files are specified \f[CR]rspamc\f[R] reads from the standard |
| 62 |
input. |
| 63 |
Controller commands usually do not accept any input, however learn* and |
| 64 |
fuzzy* commands requires input. |
| 65 |
.SH OPTIONS |
| 66 |
.TP |
| 67 |
\-h \f[I]host[:port]\f[R], \-\-connect=\f[I]host[:port]\f[R] |
| 68 |
Specify host and port |
| 69 |
.TP |
| 70 |
\-P \f[I]password\f[R], \-\-password=\f[I]password\f[R] |
| 71 |
Specify control password. Can be an absolute or relative path, in which |
| 72 |
case the password will be read from that file. |
| 73 |
.TP |
| 74 |
\-c \f[I]name\f[R], \-\-classifier=\f[I]name\f[R] |
| 75 |
Classifier to learn spam or ham (bayes is used by default) |
| 76 |
.TP |
| 77 |
\-w \f[I]weight\f[R], \-\-weight=\f[I]weight\f[R] |
| 78 |
Weight for fuzzy operations |
| 79 |
.TP |
| 80 |
\-f \f[I]number\f[R], \-\-flag=\f[I]number\f[R] |
| 81 |
Flag for fuzzy operations |
| 82 |
.TP |
| 83 |
\-p, \-\-pass |
| 84 |
Pass all filters |
| 85 |
.TP |
| 86 |
\-v, \-\-verbose |
| 87 |
More verbose output |
| 88 |
.TP |
| 89 |
\-i \f[I]ip address\f[R], \-\-ip=\f[I]ip address\f[R] |
| 90 |
Emulate that message was received from specified ip address |
| 91 |
.TP |
| 92 |
\-u \f[I]username\f[R], \-\-user=\f[I]username\f[R] |
| 93 |
Emulate that message was received from specified authenticated user |
| 94 |
.TP |
| 95 |
\-d \f[I]user\[at]domain\f[R], \-\-deliver=\f[I]user\[at]domain\f[R] |
| 96 |
Emulate that message was delivered to specified user (for |
| 97 |
LDA/statistics) |
| 98 |
.TP |
| 99 |
\-F \f[I]user\[at]domain\f[R], \-\-from=\f[I]user\[at]domain\f[R] |
| 100 |
Emulate that message has specified SMTP FROM address |
| 101 |
.TP |
| 102 |
\-r \f[I]user\[at]domain\f[R], \-\-rcpt=\f[I]user\[at]domain\f[R] |
| 103 |
Emulate that message has specified SMTP RCPT address |
| 104 |
.TP |
| 105 |
\-\-helo=\f[I]helo_string\f[R] |
| 106 |
Imitate SMTP HELO passing from MTA |
| 107 |
.TP |
| 108 |
\-\-hostname=\f[I]hostname\f[R] |
| 109 |
Imitate hostname passing from MTA (rspamd assumes that it is verified by |
| 110 |
MTA) |
| 111 |
.TP |
| 112 |
\-t \f[I]seconds\f[R], \-\-timeout=\f[I]seconds\f[R] |
| 113 |
Timeout for waiting for a reply (can be floating point number, |
| 114 |
e.g.\ 0.1) |
| 115 |
.TP |
| 116 |
\-b \f[I]host:port\f[R], \-\-bind=\f[I]host:port\f[R] |
| 117 |
Bind to specified ip address |
| 118 |
.TP |
| 119 |
\-R, \-\-human |
| 120 |
Output human readable report. |
| 121 |
The first line of the output contains the message score and three |
| 122 |
threshold scores, in this format: |
| 123 |
.IP |
| 124 |
.EX |
| 125 |
score/greylist/addheader/reject,action=N:ACTION,spam=0|1,skipped=0|1 |
| 126 |
.EE |
| 127 |
.TP |
| 128 |
\-j, \-\-json |
| 129 |
Output formatted JSON |
| 130 |
.TP |
| 131 |
\-\-ucl |
| 132 |
Output UCL |
| 133 |
.TP |
| 134 |
\-\-raw |
| 135 |
Output raw data received from rspamd (compacted JSON) |
| 136 |
.TP |
| 137 |
\-\-headers |
| 138 |
Output HTTP headers from a reply |
| 139 |
.TP |
| 140 |
\-\-extended\-urls |
| 141 |
Output URLs in an extended format, showing full URL, host and the part |
| 142 |
of host that was used by surbl module (if enabled). |
| 143 |
.TP |
| 144 |
\-n \f[I]parallel_count\f[R], \-\-max\-requests=\f[I]parallel_count\f[R] |
| 145 |
Maximum number of requests to rspamd executed in parallel (8 by default) |
| 146 |
.TP |
| 147 |
\-e \f[I]command\f[R], \-\-execute=\f[I]command\f[R] |
| 148 |
Execute the specified command with either mime output (if |
| 149 |
\f[CR]mime\f[R] option is also specified) or formatted rspamd output |
| 150 |
.TP |
| 151 |
\-\-mime |
| 152 |
Output the full mime message instead of scanning results only |
| 153 |
.TP |
| 154 |
\-\-header=\f[I]header\f[R] |
| 155 |
Add custom HTTP header for a request. |
| 156 |
You may specify header in format \f[CR]name=value\f[R] or just |
| 157 |
\f[CR]name\f[R] for an empty header. |
| 158 |
This option can be repeated multiple times. |
| 159 |
.TP |
| 160 |
\-\-sort=\f[I]type\f[R] |
| 161 |
Sort output according to a specific field. |
| 162 |
For \f[CR]counters\f[R] command the allowed values for this key are |
| 163 |
\f[CR]name\f[R], \f[CR]weight\f[R], \f[CR]frequency\f[R] and |
| 164 |
\f[CR]hits\f[R]. |
| 165 |
Appending \f[CR]:asc\f[R] to any of these types inverts sorting order. |
| 166 |
.TP |
| 167 |
\-\-commands |
| 168 |
List available commands |
| 169 |
.SH RETURN VALUE |
| 170 |
On exit \f[CR]rspamc\f[R] returns \f[CR]0\f[R] if operation was |
| 171 |
successful and an error code otherwise. |
| 172 |
.SH EXAMPLES |
| 173 |
Check stdin: |
| 174 |
.IP |
| 175 |
.EX |
| 176 |
rspamc < some_file |
| 177 |
.EE |
| 178 |
.PP |
| 179 |
Check files: |
| 180 |
.IP |
| 181 |
.EX |
| 182 |
rspamc symbols file1 file2 file3 |
| 183 |
.EE |
| 184 |
.PP |
| 185 |
Learn files: |
| 186 |
.IP |
| 187 |
.EX |
| 188 |
rspamc \-P pass learn_spam file1 file2 file3 |
| 189 |
.EE |
| 190 |
.PP |
| 191 |
Add fuzzy hash to set 2: |
| 192 |
.IP |
| 193 |
.EX |
| 194 |
rspamc \-P pass \-f 2 \-w 10 fuzzy_add file1 file2 |
| 195 |
.EE |
| 196 |
.PP |
| 197 |
Delete fuzzy hash from other server: |
| 198 |
.IP |
| 199 |
.EX |
| 200 |
rspamc \-P pass \-h hostname:11334 \-f 2 fuzzy_del file1 file2 |
| 201 |
.EE |
| 202 |
.PP |
| 203 |
Get statistics: |
| 204 |
.IP |
| 205 |
.EX |
| 206 |
rspamc stat |
| 207 |
.EE |
| 208 |
.PP |
| 209 |
Get uptime: |
| 210 |
.IP |
| 211 |
.EX |
| 212 |
rspamc uptime |
| 213 |
.EE |
| 214 |
.PP |
| 215 |
Add custom rule\[cq]s weight: |
| 216 |
.IP |
| 217 |
.EX |
| 218 |
rspamc add_symbol test 1.5 |
| 219 |
.EE |
| 220 |
.PP |
| 221 |
Add custom action\[cq]s weight: |
| 222 |
.IP |
| 223 |
.EX |
| 224 |
rspamc add_action reject 7.1 |
| 225 |
.EE |
| 226 |
.SH SEE ALSO |
| 227 |
Rspamd documentation and source code may be downloaded from \c |
| 228 |
.UR https://rspamd.com/ |
| 229 |
.UE \c |
| 230 |
\&. |