2013-12-27 19:04:56 +01:00
% RSPAMC(1) Rspamd User Manual
# NAME
2015-09-28 17:45:01 +02:00
`rspamc` - rspamd command line client
2013-12-27 19:04:56 +01:00
# SYNOPSIS
rspamc [*options*] [*command*] [*input-file*]...
rspamc --help
# DESCRIPTION
2015-09-28 17:45:01 +02:00
`rspamc` is a simple client for checking messages using rspamd or for learning rspamd by messages.
`rspamc` supports the following commands:
2013-12-27 19:04:56 +01:00
* Scan commands:
2015-09-28 17:45:01 +02:00
* `symbols` : scan message and show symbols (default command)
2013-12-27 19:04:56 +01:00
* Control commands
2015-09-28 17:45:01 +02:00
* `learn_spam` : learn message as spam
* `learn_ham` : learn message as ham
* `fuzzy_add` : add message to fuzzy storage (check `-f` and `-w` options for this command)
* `fuzzy_del` : delete message from fuzzy storage (check `-f` option for this command)
* `stat` : show rspamd statistics
* `stat_reset` : show and reset rspamd statistics (useful for graphs)
* `counters` : display rspamd symbols statistics
* `uptime` : show rspamd uptime
* `add_symbol` : add or modify symbol settings in rspamd
* `add_action` : add or modify action settings
2013-12-27 19:04:56 +01:00
Control commands that modifies rspamd state are considered as privileged and basically requires a password
to be specified with `-P` option (see **OPTIONS** , below, for details).
This depends on a controller's settings and is discussed in `rspamd-workers` page.
2015-09-28 17:45:01 +02:00
`Input files` may be either regular file(s) or a directory to scan. If no files are specified `rspamc` reads
2013-12-27 19:04:56 +01:00
from the standard input. Controller commands usually does not accept any input, however learn* and fuzzy* commands
requires input.
# OPTIONS
-h *host[:port]* , \--connect=*host[:port]*
2014-10-15 15:14:07 +02:00
: Specify host and port
2013-12-27 19:04:56 +01:00
-P *password* , \--password=*password*
2014-10-15 15:14:07 +02:00
: Specify control password
2013-12-27 19:04:56 +01:00
-c *name* , \--classifier=*name*
: Classifier to learn spam or ham (bayes is used by default)
-w *weight* , \--weight=*weight*
: Weight for fuzzy operations
-f *number* , \--flag=*number*
: Flag for fuzzy operations
-p, \--pass
: Pass all filters
-v, \--verbose
: More verbose output
-i *ip address* , \--ip=*ip address*
: Emulate that message was received from specified ip address
-u *username* , \--user=*username*
2016-06-12 15:05:27 +02:00
: Emulate that message was received from specified authenticated user
2013-12-27 19:04:56 +01:00
-d *user@domain* , \--deliver=*user@domain*
2016-06-12 15:05:27 +02:00
: Emulate that message is delivered to specified user (for LDA/statistics)
2013-12-27 19:04:56 +01:00
-F *user@domain* , \--from=*user@domain*
2016-06-12 15:05:27 +02:00
: Emulate that message has specified SMTP FROM address
2013-12-27 19:04:56 +01:00
-r *user@domain* , \--rcpt=*user@domain*
2016-06-12 15:05:27 +02:00
: Emulate that message has specified SMTP RCPT address
2013-12-27 19:04:56 +01:00
2014-01-06 17:31:27 +01:00
\--helo=*helo_string*
: Imitate SMTP HELO passing from MTA
\--hostname=*hostname*
: Imitate hostname passing from MTA (rspamd assumes that it is verified by MTA)
2013-12-27 19:04:56 +01:00
-t *seconds* , \--timeout=*seconds*
2014-10-15 15:14:07 +02:00
: Timeout for waiting for a reply (can be floating point number, e.g. 0.1)
2013-12-27 19:04:56 +01:00
-b *host:port* , \--bind=*host:port*
: Bind to specified ip address
2014-10-15 15:14:07 +02:00
-j, \--json
: Output formatted JSON
\--ucl
: Output UCL
\--raw
: Output raw data received from rspamd (compacted JSON)
\--headers
: Output HTTP headers from a reply
2014-11-25 19:37:32 +01:00
\--extended-urls
: Output URLs in an extended format, showing full URL, host and the part of host that was used by surbl module (if enabled).
2014-10-15 15:14:07 +02:00
-n *parallel_count* , \--max-requests=*parallel_count*
2014-10-15 16:29:28 +02:00
: Maximum number of requests to rspamd executed in parallel (8 by default)
2014-10-15 15:14:07 +02:00
2015-09-05 18:01:51 +02:00
-e *command* , \--execute=*command*
: Execute the specified command with either mime output (if `mime` option is also specified) or formatted rspamd output
\--mime
: Output the full mime message instead of scanning results only
2015-10-19 18:16:21 +02:00
\--header=*header*
: 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.
2015-10-19 20:07:00 +02:00
\--sort=*type*
: 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.
2013-12-27 19:04:56 +01:00
\--commands
: List available commands
# RETURN VALUE
2015-09-28 17:45:01 +02:00
On exit `rspamc` returns `0` if operation was successfull and an error code otherwise.
2013-12-27 19:04:56 +01:00
# EXAMPLES
Check stdin:
rspamc < some_file
Check files:
rspamc symbols file1 file2 file3
Learn files:
rspamc -P pass learn_spam file1 file2 file3
Add fuzzy hash to set 2:
rspamc -P pass -f 2 -w 10 fuzzy_add file1 file2
Delete fuzzy hash from other server:
rspamc -P pass -h hostname:11334 -f 2 fuzzy_del file1 file2
Get statistics:
rspamc stat
Get uptime:
rspamc uptime
Add custom rule's weight:
rspamc add_symbol test 1.5
Add custom action's weight:
rspamc add_action reject 7.1
# SEE ALSO
Rspamd documentation and source codes may be downloaded from
< https: / / rspamd . com / > .
2016-06-12 15:05:27 +02:00
[rspamd-workers]: https://rspamd.com/doc/workers/