Skip to main content

Rspamadm Administration Utility

The rspamadm command is a powerful administration utility that provides a comprehensive set of tools for managing, debugging, and operating Rspamd installations. It consolidates various administrative functions into a single command-line interface.

Quick Start

To see all available commands:

rspamadm -l

To get help for a specific command:

rspamadm [command] --help

Commands by Category

Email Analysis & Debugging

Tools for inspecting and analyzing email messages.

CommandPurpose
mime extractExtract text, HTML, or words from messages
mime statExtract statistical data (Bayes tokens, fuzzy hashes)
mime urlsExtract and analyze URLs from messages
mime dumpDump messages in various formats

Learn more →

Email Manipulation

Tools for modifying and sanitizing email messages.

CommandPurpose
mime anonymizeRemove sensitive information for bug reports
mime modifyAdd/remove/rewrite headers and footers
mime stripRemove attachments from messages
mime signPerform DKIM/ARC signing

Learn more →

DNS & SPF Management

Tools for DNS operations and SPF record optimization.

CommandPurpose
dnstool spfQuery and debug SPF records
dnstool spf-flattenFlatten SPF records to avoid lookup limits

Learn more →

DKIM Key Management

Tools for generating and managing DKIM signing keys.

CommandPurpose
dkim_keygenGenerate DKIM keypairs
vaultIntegrate with Hashicorp Vault for key storage
signtoolSign and verify files with keypairs

Learn more →

Cryptography & Security

Tools for encryption, signing, and password management.

CommandPurpose
keypairGenerate and manage encryption/signing keypairs
secret_boxEncrypt/decrypt text with symmetric keys
pwGenerate and check password hashes
signtoolSign and verify files

Learn more →

Statistics & Machine Learning

Tools for managing statistical classifiers and neural networks.

CommandPurpose
statistics_dumpBackup and restore Bayes statistics
statconvertConvert statistics from SQLite to Redis
classifiertestEvaluate Bayes classifier performance
neuraltestTest neural network with labeled datasets
clickhouse neural_profileGenerate neural network profiles

Learn more →

Operations & Monitoring

Tools for operational tasks and monitoring.

CommandPurpose
grepSearch and collate logs by pattern
fuzzy_pingTest fuzzy storage connectivity
ratelimitManage rate limit buckets
controlSend commands to running Rspamd instance
dmarc_reportSend DMARC aggregate reports
fuzzyconvertMigrate fuzzy hashes to Redis

Learn more →

Configuration Management

Tools for configuration validation and inspection.

CommandPurpose
configtestValidate configuration syntax
configdumpShow effective configuration
confighelpShow configuration option documentation
configgraphVisualize configuration include hierarchy
configwizardInteractive configuration setup
templateApply Jinja templates to files

Learn more →

Development & Testing

Tools for developers and advanced testing.

CommandPurpose
corpustestTest rules against email corpus
cookieGenerate message IDs and cookies
luaInteractive Lua REPL with Rspamd API
publicsuffixCompile public suffix lists

Learn more →

Common Usage Patterns

Debugging Email Issues

When investigating why a message was scored incorrectly:

# Extract all data Rspamd sees
rspamadm mime extract -t message.eml
rspamadm mime urls -f message.eml
rspamadm mime stat -b message.eml

# Search logs for that message
rspamadm grep -p "message-id-here" /var/log/rspamd/rspamd.log

Preparing Bug Reports

Sanitize emails before sharing:

# Remove sensitive information
rspamadm mime anonymize --gpt message.eml > sanitized.eml

SPF Management

Optimize SPF records that hit DNS lookup limits:

# Check current SPF
rspamadm dnstool spf -d example.com

# Flatten if needed
rspamadm dnstool spf-flatten example.com

Configuration Validation

Before restarting Rspamd:

# Validate syntax
rspamadm configtest

# Check effective configuration
rspamadm configdump | less

Global Options

Most commands support these global options:

  • -c, --config - Path to configuration file (default: /etc/rspamd/rspamd.conf)
  • -v, --verbose - Enable verbose logging
  • --var - Override environment variables

Getting Help

  • Run rspamadm -l to list all commands
  • Run rspamadm [command] --help for detailed command help
  • Check the category pages linked above for practical examples and scenarios