RSPAMC(1) RSPAMC(1)

# [NAME](#NAME)

rspamc - rspamd command line client

# [SYNOPSIS](#SYNOPSIS)

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

rspamc –help

# [DESCRIPTION](#DESCRIPTION)

rspamc is a simple rspamd client, primarily for classifying or learning messages. rspamc supports the following commands:

•

Scan commands:

•

symbols: scan message and show symbols (default command)

•

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

Control commands that modify rspamd state are considered privileged and require a password to be specified with the -P option (see **OPTIONS**, below, for details).

This depends on a controller’s settings and is discussed in the rspamd-workers page (see **SEE ALSO**, below, for details).

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](#OPTIONS)

[-h *host\[:port\]*, --connect=*host\[:port\]*](#h)

Specify host and port

[-P *password*, --password=*password*](#P)

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*](#c)

Classifier to learn spam or ham (bayes is used by default)

[-w *weight*, --weight=*weight*](#w)

Weight for fuzzy operations

[-f *number*, --flag=*number*](#f)

Flag for fuzzy operations

[-p, --pass](#p,)

Pass all filters

[-v, --verbose](#v,)

More verbose output

[-i *ip address*, --ip=*ip address*](#i)

Emulate that message was received from specified ip address

[-u *username*, --user=*username*](#u)

Emulate that message was received from specified authenticated user

[-d *user@domain*, --deliver=*user@domain*](#d)

Emulate that message was delivered to specified user (for LDA/statistics)

[-F *user@domain*, --from=*user@domain*](#F)

Emulate that message has specified SMTP FROM address

[-r *user@domain*, --rcpt=*user@domain*](#r)

Emulate that message has specified SMTP RCPT address

[--helo=*helo\_string*](#helo=)

Imitate SMTP HELO passing from MTA

[--hostname=*hostname*](#hostname=)

Imitate hostname passing from MTA (rspamd assumes that it is verified by MTA)

[-t *seconds*, --timeout=*seconds*](#t)

Timeout for waiting for a reply (can be floating point number, e.g. 0.1)

[-b *host:port*, --bind=*host:port*](#b)

Bind to specified ip address

[-R, --human](#R,)

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](#j,)

Output formatted JSON

[--ucl](#ucl)

Output UCL

[--raw](#raw)

Output raw data received from rspamd (compacted JSON)

[--headers](#headers)

Output HTTP headers from a reply

[--extended-urls](#extended)

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*](#n)

Maximum number of requests to rspamd executed in parallel (8 by default)

[-e *command*, --execute=*command*](#e)

Execute the specified command with either mime output (if mime option is also specified) or formatted rspamd output

[--mime](#mime)

Output the full mime message instead of scanning results only

[--header=*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=)

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](#commands)

List available commands

# [RETURN VALUE](#RETURN_VALUE)

On exit rspamc returns 0 if operation was successful and an error code otherwise.

# [EXAMPLES](#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](#SEE_ALSO)

Rspamd documentation and source code may be downloaded from [https://rspamd.com/](https://rspamd.com/).

Rspamd User Manual

---

Document: rspamc(1) from rspamd 4.2.0-r1 (Chainguard OS)
Source: https://github.com/rspamd/rspamd
