You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rspamc.1 6.1KB

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