{
    "mode": "man",
    "parameter": "rspamc",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/rspamc/1/json",
    "generated": "2026-10-23T20:17:35Z",
    "synopsis": "rspamc [options] [command] [input-file]...\nrspamc –help",
    "sections": {
        "NAME": {
            "content": "rspamc - rspamd command line client\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "rspamc [options] [command] [input-file]...\n\nrspamc –help\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "rspamc  is  a  simple  rspamd client, primarily for classifying or learning messages.  rspamc\nsupports the following commands:\n\n• Scan commands:\n\n• symbols: scan message and show symbols (default command)\n\n• Control commands\n\n• learnspam: learn message as spam\n\n• learnham: learn message as ham\n\n• fuzzyadd: add message to fuzzy storage (check -f and -w options for this command)\n\n• fuzzydel: delete message from fuzzy storage (check -f option for this command)\n\n• stat: show rspamd statistics\n\n• statreset: show and reset rspamd statistics (useful for graphs)\n\n• counters: display rspamd symbols statistics\n\n• uptime: show rspamd uptime\n\n• addsymbol: add or modify symbol settings in rspamd\n\n• addaction: add or modify action settings\n\nControl commands that modify rspamd state are considered privileged and require a password to\nbe specified with the -P option (see OPTIONS, below, for details).\nThis depends on a controller’s settings and is discussed in the rspamd-workers page (see  SEE\nALSO, below, for details).\n\nInput  files may be either regular file(s) or a directory to scan.  If no files are specified\nrspamc reads from the standard input.  Controller commands usually do not accept  any  input,\nhowever learn* and fuzzy* commands requires input.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "-h host[:port], --connect=host[:port]\nSpecify host and port\n\n-P password, --password=password\nSpecify control password. Can be an absolute or relative path, in which case the pass‐\nword will be read from that file.\n\n-c name, --classifier=name\nClassifier to learn spam or ham (bayes is used by default)\n\n-w weight, --weight=weight\nWeight for fuzzy operations\n\n-f number, --flag=number\nFlag for fuzzy operations\n",
            "subsections": [
                {
                    "name": "-p, --pass",
                    "content": "Pass all filters\n",
                    "flag": "-p",
                    "long": "--pass"
                },
                {
                    "name": "-v, --verbose",
                    "content": "More verbose output\n\n-i ip address, --ip=ip address\nEmulate that message was received from specified ip address\n\n-u username, --user=username\nEmulate that message was received from specified authenticated user\n\n-d user@domain, --deliver=user@domain\nEmulate that message was delivered to specified user (for LDA/statistics)\n\n-F user@domain, --from=user@domain\nEmulate that message has specified SMTP FROM address\n\n-r user@domain, --rcpt=user@domain\nEmulate that message has specified SMTP RCPT address\n\n--helo=helostring\nImitate SMTP HELO passing from MTA\n\n--hostname=hostname\nImitate hostname passing from MTA (rspamd assumes that it is verified by MTA)\n\n-t seconds, --timeout=seconds\nTimeout for waiting for a reply (can be floating point number, e.g. 0.1)\n\n-b host:port, --bind=host:port\nBind to specified ip address\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "-R, --human",
                    "content": "Output human readable report.  The first line of the output contains the message score\nand three threshold scores, in this format:\n\nscore/greylist/addheader/reject,action=N:ACTION,spam=0|1,skipped=0|1\n",
                    "flag": "-R",
                    "long": "--human"
                },
                {
                    "name": "-j, --json",
                    "content": "Output formatted JSON\n\n--ucl  Output UCL\n\n--raw  Output raw data received from rspamd (compacted JSON)\n",
                    "flag": "-j",
                    "long": "--json"
                },
                {
                    "name": "--headers",
                    "content": "Output HTTP headers from a reply\n",
                    "long": "--headers"
                },
                {
                    "name": "--extended-urls",
                    "content": "Output  URLs  in  an extended format, showing full URL, host and the part of host that\nwas used by surbl module (if enabled).\n\n-n parallelcount, --max-requests=parallelcount\nMaximum number of requests to rspamd executed in parallel (8 by default)\n\n-e command, --execute=command\nExecute the specified command with either mime output (if mime option is  also  speci‐\nfied) or formatted rspamd output\n\n--mime Output the full mime message instead of scanning results only\n\n--header=header\nAdd  custom HTTP header for a request.  You may specify header in format name=value or\njust name for an empty header.  This option can be repeated multiple times.\n\n--sort=type\nSort output according to a specific field.  For counters command  the  allowed  values\nfor  this  key  are  name, weight, frequency and hits.  Appending :asc to any of these\ntypes inverts sorting order.\n",
                    "long": "--extended-urls"
                },
                {
                    "name": "--commands",
                    "content": "List available commands\n",
                    "long": "--commands"
                }
            ]
        },
        "RETURN VALUE": {
            "content": "On exit rspamc returns 0 if operation was successful and an error code otherwise.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "Check stdin:\n\nrspamc < somefile\n\nCheck files:\n\nrspamc symbols file1 file2 file3\n\nLearn files:\n\nrspamc -P pass learnspam file1 file2 file3\n\nAdd fuzzy hash to set 2:\n\nrspamc -P pass -f 2 -w 10 fuzzyadd file1 file2\n\nDelete fuzzy hash from other server:\n\nrspamc -P pass -h hostname:11334 -f 2 fuzzydel file1 file2\n\nGet statistics:\n\nrspamc stat\n\nGet uptime:\n\nrspamc uptime\n\nAdd custom rule’s weight:\n\nrspamc addsymbol test 1.5\n\nAdd custom action’s weight:\n\nrspamc addaction reject 7.1\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Rspamd documentation and source code may be downloaded from https://rspamd.com/.\n\nRspamd User Manual                                                                         RSPAMC(1)",
            "subsections": []
        }
    },
    "summary": "rspamc - rspamd command line client",
    "flags": [
        {
            "flag": "-p",
            "long": "--pass",
            "arg": null,
            "description": "Pass all filters"
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "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=helostring 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"
        },
        {
            "flag": "-R",
            "long": "--human",
            "arg": null,
            "description": "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"
        },
        {
            "flag": "-j",
            "long": "--json",
            "arg": null,
            "description": "Output formatted JSON --ucl Output UCL --raw Output raw data received from rspamd (compacted JSON)"
        },
        {
            "flag": "",
            "long": "--headers",
            "arg": null,
            "description": "Output HTTP headers from a reply"
        },
        {
            "flag": "",
            "long": "--extended-urls",
            "arg": null,
            "description": "Output URLs in an extended format, showing full URL, host and the part of host that was used by surbl module (if enabled). -n parallelcount, --max-requests=parallelcount 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 speci‐ fied) 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."
        },
        {
            "flag": "",
            "long": "--commands",
            "arg": null,
            "description": "List available commands"
        }
    ],
    "examples": [
        "Check stdin:",
        "rspamc < somefile",
        "Check files:",
        "rspamc symbols file1 file2 file3",
        "Learn files:",
        "rspamc -P pass learnspam file1 file2 file3",
        "Add fuzzy hash to set 2:",
        "rspamc -P pass -f 2 -w 10 fuzzyadd file1 file2",
        "Delete fuzzy hash from other server:",
        "rspamc -P pass -h hostname:11334 -f 2 fuzzydel file1 file2",
        "Get statistics:",
        "rspamc stat",
        "Get uptime:",
        "rspamc uptime",
        "Add custom rule’s weight:",
        "rspamc addsymbol test 1.5",
        "Add custom action’s weight:",
        "rspamc addaction reject 7.1"
    ],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Client for `rspamd` servers.",
        "examples": [
            {
                "description": "Train the bayesian filter to recognise an email as spam",
                "command": "rspamc learn_spam {{path/to/email_file}}"
            },
            {
                "description": "Train the bayesian filter to recognize an email as ham",
                "command": "rspamc learn_ham {{path/to/email_file}}"
            },
            {
                "description": "Generate a manual report on an email",
                "command": "rspamc symbols {{path/to/email_file}}"
            },
            {
                "description": "Show server statistics",
                "command": "rspamc stat"
            }
        ]
    }
}