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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. .TH "RSPAMC" "1" "" "Rspamd User Manual" ""
  2. .SH NAME
  3. .PP
  4. rspamc \- 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. Rspamc is a simple client for checking messages using rspamd or for
  13. learning rspamd by messages.
  14. Rspamc supports the following commands:
  15. .IP \[bu] 2
  16. Scan commands:
  17. .RS 2
  18. .IP \[bu] 2
  19. \f[I]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[I]learn_spam\f[]: learn message as spam
  26. .IP \[bu] 2
  27. \f[I]learn_ham\f[]: learn message as ham
  28. .IP \[bu] 2
  29. \f[I]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[I]fuzzy_del\f[]: delete message from fuzzy storage (check
  33. \f[C]\-f\f[] option for this command)
  34. .IP \[bu] 2
  35. \f[I]stat\f[]: show rspamd statistics
  36. .IP \[bu] 2
  37. \f[I]stat_reset\f[]: show and reset rspamd statistics (useful for
  38. graphs)
  39. .IP \[bu] 2
  40. \f[I]counters\f[]: display rspamd symbols statistics
  41. .IP \[bu] 2
  42. \f[I]uptime\f[]: show rspamd uptime
  43. .IP \[bu] 2
  44. \f[I]add_symbol\f[]: add or modify symbol settings in rspamd
  45. .IP \[bu] 2
  46. \f[I]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 rspamc 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[],
  171. \-\-max\-requests=\f[I]parallel_count\f[]
  172. Maximum number of requests to rspamd executed in parallel (8 by default)
  173. .RS
  174. .RE
  175. .TP
  176. .B \-\-commands
  177. List available commands
  178. .RS
  179. .RE
  180. .SH RETURN VALUE
  181. .PP
  182. On exit rspamc returns \f[C]0\f[] if operation was successfull and an
  183. error code otherwise.
  184. .SH EXAMPLES
  185. .PP
  186. Check stdin:
  187. .IP
  188. .nf
  189. \f[C]
  190. rspamc\ <\ some_file
  191. \f[]
  192. .fi
  193. .PP
  194. Check files:
  195. .IP
  196. .nf
  197. \f[C]
  198. rspamc\ symbols\ file1\ file2\ file3
  199. \f[]
  200. .fi
  201. .PP
  202. Learn files:
  203. .IP
  204. .nf
  205. \f[C]
  206. rspamc\ \-P\ pass\ learn_spam\ file1\ file2\ file3
  207. \f[]
  208. .fi
  209. .PP
  210. Add fuzzy hash to set 2:
  211. .IP
  212. .nf
  213. \f[C]
  214. rspamc\ \-P\ pass\ \-f\ 2\ \-w\ 10\ fuzzy_add\ file1\ file2
  215. \f[]
  216. .fi
  217. .PP
  218. Delete fuzzy hash from other server:
  219. .IP
  220. .nf
  221. \f[C]
  222. rspamc\ \-P\ pass\ \-h\ hostname:11334\ \-f\ 2\ fuzzy_del\ file1\ file2
  223. \f[]
  224. .fi
  225. .PP
  226. Get statistics:
  227. .IP
  228. .nf
  229. \f[C]
  230. rspamc\ stat
  231. \f[]
  232. .fi
  233. .PP
  234. Get uptime:
  235. .IP
  236. .nf
  237. \f[C]
  238. rspamc\ uptime
  239. \f[]
  240. .fi
  241. .PP
  242. Add custom rule\[aq]s weight:
  243. .IP
  244. .nf
  245. \f[C]
  246. rspamc\ add_symbol\ test\ 1.5
  247. \f[]
  248. .fi
  249. .PP
  250. Add custom action\[aq]s weight:
  251. .IP
  252. .nf
  253. \f[C]
  254. rspamc\ add_action\ reject\ 7.1
  255. \f[]
  256. .fi
  257. .SH SEE ALSO
  258. .PP
  259. Rspamd documentation and source codes may be downloaded from
  260. <https://rspamd.com/>.