RSPAMC(1)

πŸ“¦
version 4.2.3 Β· 4 versions
, in alpine 3.24, arch rolling, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu stonking

πŸ’– rspamc(1) β€” the rspamd command line client, bestie edition πŸ’–

okay so welcome to rspamc, the glow-up command line client for rspamd ✨ this is page one of the Rspamd User Manual and honestly? she's iconic. let's get into it 🫢


🌸 NAME 🌸

rspamc β€” rspamd command line client. that's it, that's the name, she's simple and she knows it πŸ’…


✨ SYNOPSIS ✨

rspamc [options] [command] [input-file]...

rspamc –help

πŸ¦‹ DESCRIPTION πŸ¦‹

so rspamc is a simple rspamd client, and her whole thing is classifying or learning messages πŸŽ€ she supports these commands, and yes we're listing every single one because nobody gets left behind:

  • Scan commands:
    • symbols: scan message and show symbols β€” this is the default command, so if you're lazy (respect) this is what runs πŸ‘‘
  • Control commands
    • 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
⚠️ okay listen up bestie β€” control commands that modify rspamd state are considered privileged and they require a password to be specified with the -P option (peep OPTIONS below for the deets). this depends on a controller's settings and is discussed in the rspamd-workers page (see SEE ALSO below, iykyk).

Input files may be either regular file(s) or a directory to scan. if no files are specified, rspamc reads from the standard input. controller commands usually do not accept any input, however learn* and fuzzy* commands requires input πŸ™ˆ


πŸ’… OPTIONS πŸ’…

  • -h host[:port], --connect=host[:port] β€” specify host and port
  • -P password, --password=password β€” specify control password. can be an absolute or relative path, in which case the password will be read from that file πŸ”
  • -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 β€” emulate that message was received from specified authenticated user
  • -d user@domain, --deliver=user@domain β€” emulate that message was delivered to specified user (for LDA/statistics)
  • -F user@domain, --from=user@domain β€” emulate that message has specified SMTP FROM address
  • -r user@domain, --rcpt=user@domain β€” emulate that message has specified SMTP RCPT address
  • --helo=helo_string β€” imitate SMTP HELO passing from MTA
  • --hostname=hostname β€” imitate hostname passing from MTA (rspamd assumes that it is verified by MTA)
  • -t seconds, --timeout=seconds β€” timeout for waiting for a reply (can be floating point number, e.g. 0.1)
  • -b host:port, --bind=host:port β€” bind to specified ip address
  • -R, --human β€” output human readable report. the first line of the output contains the message score and three threshold scores, in this format:
score/greylist/addheader/reject,action=N:ACTION,spam=0|1,skipped=0|1
  • -j, --json β€” output formatted JSON
  • --ucl β€” output UCL
  • --raw β€” output raw data received from rspamd (compacted JSON)
  • --headers β€” output HTTP headers from a reply
  • --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).
  • -n parallel_count, --max-requests=parallel_count β€” maximum number of requests to rspamd executed in parallel (8 by default)
  • -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
  • --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 πŸ”
  • --sort=type β€” sort output according to a specific field. for counters command the allowed values for this key are name, weight, frequency and hits. appending :asc to any of these types inverts sorting order.
  • --commands β€” list available commands

🌈 RETURN VALUE 🌈

on exit rspamc returns 0 if operation was successful and an error code otherwise. simple as that bestie ✨


πŸŽ€ 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 code may be downloaded from https://rspamd.com/. go read it, she ate πŸ”₯


and that's the whole page, bestie!! this was page RSPAMC(1) of the Rspamd User Manual β€” mwah, sending you off with a forehead kiss and a working config πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from