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 5.7KB

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