RSPAMC(1)
π 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-fand-woptions for this command)fuzzy_del: delete message from fuzzy storage (check-foption for this command)stat: show rspamd statisticsstat_reset: show and reset rspamd statistics (useful for graphs)counters: display rspamd symbols statisticsuptime: show rspamd uptimeadd_symbol: add or modify symbol settings in rspamdadd_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 (bayesis 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 bysurblmodule (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 formatname=valueor justnamefor an empty header. this option can be repeated multiple times π--sort=typeβ sort output according to a specific field. forcounterscommand the allowed values for this key arename,weight,frequencyandhits. appending:ascto 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
- alpine 3.24: rspamd-doc 4.0.1-r0 Β· Apache-2.0 BSD-1-Clause BSD-2-Clause BSD-3-Clause CC0-1.0 LGPL-2.1-or-later LGPL-3.0-only MIT Zlib
- arch rolling: rspamd 4.2.3-1 Β· Apache-2.0
- debian trixie: rspamd 3.12.1-1 Β· Apache-2.0
- nixos 26.05: rspamd 4.0.1
- nixpkgs unstable: rspamd 4.2.3
- ubuntu stonking: rspamd 4.0.1-1ubuntu2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms