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.md 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. % RSPAMC(1) Rspamd User Manual
  2. # NAME
  3. `rspamc` - rspamd command line client
  4. # SYNOPSIS
  5. rspamc [*options*] [*command*] [*input-file*]...
  6. rspamc --help
  7. # DESCRIPTION
  8. `rspamc` is a simple client for checking messages using rspamd or for learning rspamd by messages.
  9. `rspamc` supports the following commands:
  10. * Scan commands:
  11. * `symbols`: scan message and show symbols (default command)
  12. * Control commands
  13. * `learn_spam`: learn message as spam
  14. * `learn_ham`: learn message as ham
  15. * `fuzzy_add`: add message to fuzzy storage (check `-f` and `-w` options for this command)
  16. * `fuzzy_del`: delete message from fuzzy storage (check `-f` option for this command)
  17. * `stat`: show rspamd statistics
  18. * `stat_reset`: show and reset rspamd statistics (useful for graphs)
  19. * `counters`: display rspamd symbols statistics
  20. * `uptime`: show rspamd uptime
  21. * `add_symbol`: add or modify symbol settings in rspamd
  22. * `add_action`: add or modify action settings
  23. Control commands that modifies rspamd state are considered as privileged and basically requires a password
  24. to be specified with `-P` option (see **OPTIONS**, below, for details).
  25. This depends on a controller's settings and is discussed in `rspamd-workers` page.
  26. `Input files` may be either regular file(s) or a directory to scan. If no files are specified `rspamc` reads
  27. from the standard input. Controller commands usually does not accept any input, however learn* and fuzzy* commands
  28. requires input.
  29. # OPTIONS
  30. -h *host[:port]*, \--connect=*host[:port]*
  31. : Specify host and port
  32. -P *password*, \--password=*password*
  33. : Specify control password
  34. -c *name*, \--classifier=*name*
  35. : Classifier to learn spam or ham (bayes is used by default)
  36. -w *weight*, \--weight=*weight*
  37. : Weight for fuzzy operations
  38. -f *number*, \--flag=*number*
  39. : Flag for fuzzy operations
  40. -p, \--pass
  41. : Pass all filters
  42. -v, \--verbose
  43. : More verbose output
  44. -i *ip address*, \--ip=*ip address*
  45. : Emulate that message was received from specified ip address
  46. -u *username*, \--user=*username*
  47. : Emulate that message was from specified user
  48. -d *user@domain*, \--deliver=*user@domain*
  49. : Emulate that message is delivered to specified user
  50. -F *user@domain*, \--from=*user@domain*
  51. : Emulate that message is from specified user
  52. -r *user@domain*, \--rcpt=*user@domain*
  53. : Emulate that message is for specified user
  54. \--helo=*helo_string*
  55. : Imitate SMTP HELO passing from MTA
  56. \--hostname=*hostname*
  57. : Imitate hostname passing from MTA (rspamd assumes that it is verified by MTA)
  58. -t *seconds*, \--timeout=*seconds*
  59. : Timeout for waiting for a reply (can be floating point number, e.g. 0.1)
  60. -b *host:port*, \--bind=*host:port*
  61. : Bind to specified ip address
  62. -j, \--json
  63. : Output formatted JSON
  64. \--ucl
  65. : Output UCL
  66. \--raw
  67. : Output raw data received from rspamd (compacted JSON)
  68. \--headers
  69. : Output HTTP headers from a reply
  70. \--extended-urls
  71. : Output URLs in an extended format, showing full URL, host and the part of host that was used by surbl module (if enabled).
  72. -n *parallel_count*, \--max-requests=*parallel_count*
  73. : Maximum number of requests to rspamd executed in parallel (8 by default)
  74. -e *command*, \--execute=*command*
  75. : Execute the specified command with either mime output (if `mime` option is also specified) or formatted rspamd output
  76. \--mime
  77. : Output the full mime message instead of scanning results only
  78. \--header=*header*
  79. : Add custom HTTP header for a request. You may specify header in format `name=value` or just `name` for an empty header. This option can be repeated multiple times.
  80. \--sort=*type*
  81. : Sort output according to a specific field. For `counters` command the allowed values for this key are `name`, `weight`, `frequency` and `time`. Appending `:desc` to any of these types inverts sorting order.
  82. \--commands
  83. : List available commands
  84. # RETURN VALUE
  85. On exit `rspamc` returns `0` if operation was successfull and an error code otherwise.
  86. # EXAMPLES
  87. Check stdin:
  88. rspamc < some_file
  89. Check files:
  90. rspamc symbols file1 file2 file3
  91. Learn files:
  92. rspamc -P pass learn_spam file1 file2 file3
  93. Add fuzzy hash to set 2:
  94. rspamc -P pass -f 2 -w 10 fuzzy_add file1 file2
  95. Delete fuzzy hash from other server:
  96. rspamc -P pass -h hostname:11334 -f 2 fuzzy_del file1 file2
  97. Get statistics:
  98. rspamc stat
  99. Get uptime:
  100. rspamc uptime
  101. Add custom rule's weight:
  102. rspamc add_symbol test 1.5
  103. Add custom action's weight:
  104. rspamc add_action reject 7.1
  105. # SEE ALSO
  106. Rspamd documentation and source codes may be downloaded from
  107. <https://rspamd.com/>.
  108. [rspamd-workers]: https://rspamd.com/doc/workers/