CLI Commands Reference¶
Complete reference of Mailborder command-line utilities.
System Management¶
mb-status¶
Check status of all Mailborder services.
Output:
Mailborder V6 System Status
============================
Services:
mb-rpcd [RUNNING] PID 1234
mb-milter [RUNNING] PID 1235
mb-filter [RUNNING] PID 1237
mb-virtuoso [RUNNING] PID 1238
Dependencies:
MariaDB [RUNNING] PID 987
Redis [RUNNING] PID 988
Postfix [RUNNING] PID 989
System Health: GOOD
Options: - --json - Output in JSON format - --verbose - Detailed information
mb-config¶
Manage system configuration.
Get Configuration:
# Show all config
sudo mb-config show
# Show specific section
sudo mb-config show spam
sudo mb-config show email
# Get specific value
sudo mb-config get spam.threshold.pass
Set Configuration:
Verify Configuration:
Reload Configuration:
mb-setup¶
Initial system setup (run once after installation).
Options: - --offline - Offline mode (no Internet checks) - --force - Force re-setup
mb-update¶
Update virus/spam signatures and software.
# Update everything
sudo mb-update
# Update only antivirus signatures
sudo mb-update --antivirus
# Update only spam signatures
sudo mb-update --spam
# Check for software updates
sudo mb-update --check
mb-doctor¶
System health check and diagnostics.
Checks: - Service status - Database connectivity - Disk space - Memory usage - Configuration validity - Log permissions
Output:
[OK] All services running
[OK] Database connected
[WARNING] Disk space at 82%
[OK] Memory usage normal
[OK] Configuration valid
User Management¶
mb-admin-list¶
List administrator accounts.
Options: - --locked - Show only locked accounts - --disabled - Show only disabled accounts
mb-admin-create¶
Create new administrator account.
Options: - --email - Email address (required) - --name - Full name - --password - Password (prompted if not provided) - --priv - Privilege level (1-10)
mb-admin-reset¶
Reset administrator password.
mb-admin-disable / mb-admin-enable¶
Disable or enable user account.
mb-admin-unlock¶
Unlock locked user account.
mb-admin-delete¶
Delete user account.
Caution: Permanent deletion!
Authentication¶
mb-2fa-enable¶
Enable 2FA for user.
Output: - QR code - Secret key - Backup codes
mb-2fa-disable¶
Disable 2FA for user.
mb-2fa-verify¶
Verify TOTP code.
mb-2fa-backup-codes¶
Generate backup codes.
mb-passkey-list¶
List user's passkeys.
mb-passkey-remove¶
Remove passkey.
Email Management¶
mb-domain¶
Manage accepted domains.
List domains:
Add domain:
Remove domain:
mb-whitelist / mb-blacklist¶
Manage whitelists and blacklists.
Add to whitelist:
sudo mb-whitelist add sender@example.com
sudo mb-whitelist add @example.com
sudo mb-whitelist add 203.0.113.10
Add to blacklist:
List:
Remove:
mb-quarantine-list¶
List quarantined emails.
Options: - --since "2025-01-01" - Date filter - --sender sender@example.com - Filter by sender - --recipient user@example.com - Filter by recipient - --limit 50 - Limit results
mb-quarantine-release¶
Release quarantined email.
mb-quarantine-delete¶
Delete quarantined email.
mb-quarantine-extract¶
Extract quarantined email to file.
Spam Management¶
mb-rspamd-learn¶
Train Bayesian filter.
Learn spam:
Learn ham:
Reset and retrain:
mb-spam-test¶
Test spam scoring.
mb-spam-keyword¶
Manage spam keywords.
Add keyword:
Remove keyword:
List keywords:
mb-rbl¶
Manage RBL servers.
Add RBL:
Remove RBL:
List RBLs:
Virus Management¶
mb-antivirus-block-ext¶
Manage blocked file extensions.
Add extension:
Remove extension:
List extensions:
mb-antivirus-whitelist¶
Whitelist files/senders from virus scanning.
By hash:
By sender:
mb-antivirus-stats¶
View virus detection statistics.
Options: - --by-virus - Group by virus name - --by-sender - Group by sender - --since "2025-01-01" - Date filter
Backup and Restore¶
mb-backup¶
Create backup.
Full backup:
Incremental backup:
Configuration only:
Database only:
Custom output:
mb-restore¶
Restore from backup.
Full restore:
Configuration only:
Database only:
Dry run:
mb-backup-verify¶
Verify backup integrity.
mb-backup-list¶
List available backups.
Maintenance¶
mb-maintenance¶
Perform maintenance tasks.
Optimize database:
Cleanup logs:
Cleanup quarantine:
All tasks:
mb-dns-cache-clear¶
Clear DNS cache.
mb-redis-flush¶
Flush Redis cache.
Options: - --all - Flush all databases - --db 0 - Flush specific database
Testing and Diagnostics¶
mb-test-relay¶
Test relay host connectivity.
mb-test-ldap¶
Test LDAP authentication.
Options: - --verbose - Detailed output
mb-test-recipient¶
Test recipient validation.
mb-test-smtp¶
Test SMTP connection.
mb-test-spam¶
Test spam filtering on file.
Logging and Reporting¶
mb-audit-log¶
View audit logs.
Recent activity:
By type:
By user:
Date range:
Export:
mb-report¶
Generate reports.
Email volume:
Spam statistics:
Virus detections:
Custom report:
mb-spam-stats¶
View spam statistics.
Options: - --domain example.com - Per-domain stats - --false-positives - False positive rate - --false-negatives - False negative rate
License Management¶
mb-license¶
Manage license.
View status:
Activate license:
Offline activation:
# Generate request
sudo mb-license --offline-request > activation-request.txt
# Apply response
sudo mb-license --offline-response < activation-response.txt
Deactivate:
API Key Management¶
mb-api-key-generate¶
Generate API key.
mb-api-key-list¶
List API keys.
mb-api-key-revoke¶
Revoke API key.
Clustering¶
mb-cluster¶
Manage cluster configuration.
Show cluster status:
Add child node:
Remove node:
Push configuration:
Common Command Patterns¶
Chain Commands¶
# Update signatures and restart filter
sudo mb-update --antivirus && sudo systemctl restart mb-filter
# Backup before major change
sudo mb-backup --full && sudo mb-config set spam.threshold.pass 5.0
# Test and apply config
sudo mb-config --verify && sudo mb-config reload
Cron Jobs¶
# Daily backup
0 2 * * * /usr/bin/mb-backup --incremental
# Hourly signature update
0 * * * * /usr/bin/mb-update --signatures
# Weekly maintenance
0 3 * * 0 /usr/bin/mb-maintenance --all
Scripting Examples¶
Bash script to check system health:
#!/bin/bash
if ! sudo mb-status --json | jq -e '.health == "good"' > /dev/null; then
echo "Mailborder health check failed!" | mail -s "Alert" admin@example.com
fi
Monitor queue size:
#!/bin/bash
QUEUE_SIZE=$(sudo mailq | grep -c "^[A-F0-9]")
if [ "$QUEUE_SIZE" -gt 1000 ]; then
echo "Queue size is $QUEUE_SIZE" | mail -s "Queue Alert" admin@example.com
fi
Getting Help¶
Command Help¶
Most commands support --help:
Man Pages¶
See Also¶
- Configuration Files - Config file reference
- Error Codes - Error code meanings
- Log Locations - Where to find logs