Usage: rspamc [OPTION…] - run rspamc client Summary: Rspamd client version 4.2.3 Release id: release Help Options: -?, --help Show help options Application Options: -h, --connect Specify host and port -P, --password Specify control password -c, --classifier Classifier to learn spam or ham -w, --weight Weight for fuzzy operations -f, --flag Flag for fuzzy operations -p, --pass-all Pass all filters -v, --verbose More verbose output -i, --ip Emulate that message was received from specified ip address -u, --user Emulate that message was received from specified authenticated user -d, --deliver Emulate that message is delivered to specified user (for LDA/statistics) -F, --from Emulate that message has specified SMTP FROM address -r, --rcpt Emulate that message has specified SMTP RCPT address --helo Imitate SMTP HELO passing from MTA --hostname Imitate hostname passing from MTA -t, --timeout Time in seconds to wait for a reply -b, --bind Bind to specified ip address --commands List available commands -R, --human Output human readable report -j, --json Output json reply --compact Output compact json reply --headers Output HTTP headers --raw Input is a raw file, not an email file --ucl Output ucl reply from rspamd -n, --max-requests Maximum count of parallel requests to rspamd --extended-urls Output urls in extended format --key Use specified pubkey to encrypt request -e, --exec Execute the specified command and pass output to it -m, --mime Write mime body of message with headers instead of just a scan's result --header Add custom HTTP header to query (can be repeated) --metadata-header Add custom field to v3 metadata headers as KEY=VALUE or KEY:VALUE (can be repeated) --exclude Exclude specific glob patterns in file names (can be repeated) --sort Sort output in a specific order (name, weight, frequency, hits) -E, --empty Allow empty input instead of reading from stdin -S, --fuzzy-symbol Learn the specified fuzzy symbol -z, --compressed Enable zstd compression --profile Profile symbols execution time -D, --dictionary Use dictionary to compress data --skip-images Skip images when learning/unlearning fuzzy --skip-attachments Skip attachments when learning/unlearning fuzzy --protocol-v3 Use v3 multipart protocol (structured metadata, multipart response) --msgpack Use msgpack for v3 metadata and response (requires --protocol-v3) -U, --user-agent Use specific User-Agent instead of "rspamc" --files-list Read one or more newline separated filenames to scan from file --queue-id Set Queue-ID header for the request --log-tag Set Log-Tag header for the request --output-body Save rewritten message body to file --settings Set Settings header as JSON/UCL for the request
Options (48)
| Option | Description | Source |
|---|---|---|
-?, --help | Show help options | help |
-h, --connect | Specify host and port | help |
-P, --password password | Specify control password. | help + man |
-c, --classifier name | Classifier to learn spam or ham (bayes is used by default) | help + man |
-w, --weight weight | Weight for fuzzy operations | help + man |
-f, --flag number | Flag for fuzzy operations | help + man |
-p, --pass-all, --pass | Pass all filters | help + man |
-v, --verbose | More verbose output | help + man |
-i, --ip ip | Emulate that message was received from specified ip address | help + man |
-u, --user username | Emulate that message was received from specified authenticated user | help + man |
-d, --deliver user@domain | Emulate that message was delivered to specified user (for LDA/statistics) | help + man |
-F, --from user@domain | Emulate that message has specified SMTP FROM address | help + man |
-r, --rcpt user@domain | Emulate that message has specified SMTP RCPT address | help + man |
--helo helo_string | Imitate SMTP HELO passing from MTA | help + man |
--hostname hostname | Imitate hostname passing from MTA (rspamd assumes that it is verified by MTA) | help + man |
-t, --timeout seconds | Timeout for waiting for a reply (can be floating point number, e.g. 0.1) | help + man |
-b, --bind host:port | Bind to specified ip address | help + man |
--commands | List available commands | help + man |
-R, --human | Output human readable report. | help + man |
-j, --json | Output formatted JSON | help + man |
--compact | Output compact json reply | help |
--headers | Output HTTP headers from a reply | help + man |
--raw | Output raw data received from rspamd (compacted JSON) | help + man |
--ucl | Output ucl reply from rspamd | help + man |
-n, --max-requests parallel_count | Maximum number of requests to rspamd executed in parallel (8 by default) | help + man |
--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). | help + man |
--key | Use specified pubkey to encrypt request | help |
-e, --exec, --execute command | Execute the specified command with either mime output (if mime option is also specified) or formatted rspamd output | help + man |
-m, --mime | Write mime body of message with headers instead of just a scan's result | help + man |
--header header | Add custom HTTP header to query (can be repeated) | help + man |
--metadata-header | Add custom field to v3 metadata headers as KEY=VALUE or KEY:VALUE (can be repeated) | help |
--exclude | Exclude specific glob patterns in file names (can be repeated) | help |
--sort type | Sort output in a specific order (name, weight, frequency, hits) | help + man |
-E, --empty | Allow empty input instead of reading from stdin | help |
-S, --fuzzy-symbol | Learn the specified fuzzy symbol | help |
-z, --compressed | Enable zstd compression | help |
--profile | Profile symbols execution time | help |
-D, --dictionary | Use dictionary to compress data | help |
--skip-images | Skip images when learning/unlearning fuzzy | help |
--skip-attachments | Skip attachments when learning/unlearning fuzzy | help |
--protocol-v3 | Use v3 multipart protocol (structured metadata, multipart response) | help |
--msgpack | Use msgpack for v3 metadata and response (requires --protocol-v3) | help |
-U, --user-agent | Use specific User-Agent instead of "rspamc" | help |
--files-list | Read one or more newline separated filenames to scan from file | help |
--queue-id | Set Queue-ID header for the request | help |
--log-tag | Set Log-Tag header for the request | help |
--output-body | Save rewritten message body to file | help |
--settings | Set Settings header as JSON/UCL for the request | help |
Exit status (1) from the manual page
0 | operation was successful and an error code otherwise |
Examples (9) from the manual page, untested
rspamc < some_file
Check stdin:rspamc symbols file1 file2 file3
Check files:rspamc -P pass learn_spam file1 file2 file3
Learn files:rspamc -P pass -f 2 -w 10 fuzzy_add file1 file2
Add fuzzy hash to set 2:rspamc -P pass -h hostname:11334 -f 2 fuzzy_del file1 file2
Delete fuzzy hash from other server:rspamc stat
Get statistics:rspamc uptime
Get uptime:rspamc add_symbol test 1.5
Add custom rule’s weight:rspamc add_action reject 7.1
Add custom action’s weight: