summaryrefslogtreecommitdiffstats
path: root/doc/rspamc.1
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--doc/rspamc.1307
-rw-r--r--doc/rspamc.1.md173
2 files changed, 480 insertions, 0 deletions
diff --git a/doc/rspamc.1 b/doc/rspamc.1
new file mode 100644
index 0000000..0f823e6
--- /dev/null
+++ b/doc/rspamc.1
@@ -0,0 +1,307 @@
+.\" Automatically generated by Pandoc 2.2.2.1
+.\"
+.TH "RSPAMC" "1" "" "Rspamd User Manual" ""
+.hy
+.SH NAME
+.PP
+\f[C]rspamc\f[] \- rspamd command line client
+.SH SYNOPSIS
+.PP
+rspamc [\f[I]options\f[]] [\f[I]command\f[]] [\f[I]input\-file\f[]]\&...
+.PP
+rspamc \[en]help
+.SH DESCRIPTION
+.PP
+\f[C]rspamc\f[] is a simple rspamd client, primarily for classifying or
+learning messages.
+\f[C]rspamc\f[] supports the following commands:
+.IP \[bu] 2
+Scan commands:
+.RS 2
+.IP \[bu] 2
+\f[C]symbols\f[]: scan message and show symbols (default command)
+.RE
+.IP \[bu] 2
+Control commands
+.RS 2
+.IP \[bu] 2
+\f[C]learn_spam\f[]: learn message as spam
+.IP \[bu] 2
+\f[C]learn_ham\f[]: learn message as ham
+.IP \[bu] 2
+\f[C]fuzzy_add\f[]: add message to fuzzy storage (check \f[C]\-f\f[] and
+\f[C]\-w\f[] options for this command)
+.IP \[bu] 2
+\f[C]fuzzy_del\f[]: delete message from fuzzy storage (check
+\f[C]\-f\f[] option for this command)
+.IP \[bu] 2
+\f[C]stat\f[]: show rspamd statistics
+.IP \[bu] 2
+\f[C]stat_reset\f[]: show and reset rspamd statistics (useful for
+graphs)
+.IP \[bu] 2
+\f[C]counters\f[]: display rspamd symbols statistics
+.IP \[bu] 2
+\f[C]uptime\f[]: show rspamd uptime
+.IP \[bu] 2
+\f[C]add_symbol\f[]: add or modify symbol settings in rspamd
+.IP \[bu] 2
+\f[C]add_action\f[]: add or modify action settings
+.RE
+.PP
+Control commands that modify rspamd state are considered privileged and
+require a password to be specified with the \f[C]\-P\f[] option (see
+\f[B]OPTIONS\f[], below, for details).
+.PD 0
+.P
+.PD
+This depends on a controller's settings and is discussed in the
+\f[C]rspamd\-workers\f[] page (see \f[B]SEE ALSO\f[], below, for
+details).
+.PP
+\f[C]Input\ files\f[] may be either regular file(s) or a directory to
+scan.
+If no files are specified \f[C]rspamc\f[] reads from the standard input.
+Controller commands usually do not accept any input, however learn* and
+fuzzy* commands requires input.
+.SH OPTIONS
+.TP
+.B \-h \f[I]host[:port]\f[], \-\-connect=\f[I]host[:port]\f[]
+Specify host and port
+.RS
+.RE
+.TP
+.B \-P \f[I]password\f[], \-\-password=\f[I]password\f[]
+Specify control password
+.RS
+.RE
+.TP
+.B \-c \f[I]name\f[], \-\-classifier=\f[I]name\f[]
+Classifier to learn spam or ham (bayes is used by default)
+.RS
+.RE
+.TP
+.B \-w \f[I]weight\f[], \-\-weight=\f[I]weight\f[]
+Weight for fuzzy operations
+.RS
+.RE
+.TP
+.B \-f \f[I]number\f[], \-\-flag=\f[I]number\f[]
+Flag for fuzzy operations
+.RS
+.RE
+.TP
+.B \-p, \-\-pass
+Pass all filters
+.RS
+.RE
+.TP
+.B \-v, \-\-verbose
+More verbose output
+.RS
+.RE
+.TP
+.B \-i \f[I]ip address\f[], \-\-ip=\f[I]ip address\f[]
+Emulate that message was received from specified ip address
+.RS
+.RE
+.TP
+.B \-u \f[I]username\f[], \-\-user=\f[I]username\f[]
+Emulate that message was received from specified authenticated user
+.RS
+.RE
+.TP
+.B \-d \f[I]user\@domain\f[], \-\-deliver=\f[I]user\@domain\f[]
+Emulate that message was delivered to specified user (for
+LDA/statistics)
+.RS
+.RE
+.TP
+.B \-F \f[I]user\@domain\f[], \-\-from=\f[I]user\@domain\f[]
+Emulate that message has specified SMTP FROM address
+.RS
+.RE
+.TP
+.B \-r \f[I]user\@domain\f[], \-\-rcpt=\f[I]user\@domain\f[]
+Emulate that message has specified SMTP RCPT address
+.RS
+.RE
+.TP
+.B \-\-helo=\f[I]helo_string\f[]
+Imitate SMTP HELO passing from MTA
+.RS
+.RE
+.TP
+.B \-\-hostname=\f[I]hostname\f[]
+Imitate hostname passing from MTA (rspamd assumes that it is verified by
+MTA)
+.RS
+.RE
+.TP
+.B \-t \f[I]seconds\f[], \-\-timeout=\f[I]seconds\f[]
+Timeout for waiting for a reply (can be floating point number,
+e.g.\ 0.1)
+.RS
+.RE
+.TP
+.B \-b \f[I]host:port\f[], \-\-bind=\f[I]host:port\f[]
+Bind to specified ip address
+.RS
+.RE
+.TP
+.B \-R, \-\-human
+Output human readable report.
+The first line of the output contains the message score and three
+threshold scores, in this format:
+.IP
+.nf
+\f[C]
+ score/greylist/addheader/reject,action=N:ACTION,spam=0|1,skipped=0|1
+\f[]
+.fi
+.RS
+.RE
+.TP
+.B \-j, \-\-json
+Output formatted JSON
+.RS
+.RE
+.TP
+.B \-\-ucl
+Output UCL
+.RS
+.RE
+.TP
+.B \-\-raw
+Output raw data received from rspamd (compacted JSON)
+.RS
+.RE
+.TP
+.B \-\-headers
+Output HTTP headers from a reply
+.RS
+.RE
+.TP
+.B \-\-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).
+.RS
+.RE
+.TP
+.B \-n \f[I]parallel_count\f[], \-\-max\-requests=\f[I]parallel_count\f[]
+Maximum number of requests to rspamd executed in parallel (8 by default)
+.RS
+.RE
+.TP
+.B \-e \f[I]command\f[], \-\-execute=\f[I]command\f[]
+Execute the specified command with either mime output (if \f[C]mime\f[]
+option is also specified) or formatted rspamd output
+.RS
+.RE
+.TP
+.B \-\-mime
+Output the full mime message instead of scanning results only
+.RS
+.RE
+.TP
+.B \-\-header=\f[I]header\f[]
+Add custom HTTP header for a request.
+You may specify header in format \f[C]name=value\f[] or just
+\f[C]name\f[] for an empty header.
+This option can be repeated multiple times.
+.RS
+.RE
+.TP
+.B \-\-sort=\f[I]type\f[]
+Sort output according to a specific field.
+For \f[C]counters\f[] command the allowed values for this key are
+\f[C]name\f[], \f[C]weight\f[], \f[C]frequency\f[] and \f[C]hits\f[].
+Appending \f[C]:desc\f[] to any of these types inverts sorting order.
+.RS
+.RE
+.TP
+.B \-\-commands
+List available commands
+.RS
+.RE
+.SH RETURN VALUE
+.PP
+On exit \f[C]rspamc\f[] returns \f[C]0\f[] if operation was successful
+and an error code otherwise.
+.SH EXAMPLES
+.PP
+Check stdin:
+.IP
+.nf
+\f[C]
+rspamc\ <\ some_file
+\f[]
+.fi
+.PP
+Check files:
+.IP
+.nf
+\f[C]
+rspamc\ symbols\ file1\ file2\ file3
+\f[]
+.fi
+.PP
+Learn files:
+.IP
+.nf
+\f[C]
+rspamc\ \-P\ pass\ learn_spam\ file1\ file2\ file3
+\f[]
+.fi
+.PP
+Add fuzzy hash to set 2:
+.IP
+.nf
+\f[C]
+rspamc\ \-P\ pass\ \-f\ 2\ \-w\ 10\ fuzzy_add\ file1\ file2
+\f[]
+.fi
+.PP
+Delete fuzzy hash from other server:
+.IP
+.nf
+\f[C]
+rspamc\ \-P\ pass\ \-h\ hostname:11334\ \-f\ 2\ fuzzy_del\ file1\ file2
+\f[]
+.fi
+.PP
+Get statistics:
+.IP
+.nf
+\f[C]
+rspamc\ stat
+\f[]
+.fi
+.PP
+Get uptime:
+.IP
+.nf
+\f[C]
+rspamc\ uptime
+\f[]
+.fi
+.PP
+Add custom rule's weight:
+.IP
+.nf
+\f[C]
+rspamc\ add_symbol\ test\ 1.5
+\f[]
+.fi
+.PP
+Add custom action's weight:
+.IP
+.nf
+\f[C]
+rspamc\ add_action\ reject\ 7.1
+\f[]
+.fi
+.SH SEE ALSO
+.PP
+Rspamd documentation and source code may be downloaded from
+<https://rspamd.com/>.
diff --git a/doc/rspamc.1.md b/doc/rspamc.1.md
new file mode 100644
index 0000000..335c225
--- /dev/null
+++ b/doc/rspamc.1.md
@@ -0,0 +1,173 @@
+% RSPAMC(1) Rspamd User Manual
+
+# NAME
+
+`rspamc` - rspamd command line client
+
+# SYNOPSIS
+
+rspamc [*options*] [*command*] [*input-file*]...
+
+rspamc --help
+
+# 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
+
+-h *host[:port]*, \--connect=*host[:port]*
+: Specify host and port
+
+-P *password*, \--password=*password*
+: Specify control password
+
+-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.
+
+# 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/>.
+
+[rspamd-workers]: https://rspamd.com/doc/workers/