GoAdmio Command Line: filter with /go/filter

/go/filter resets the server's list of email filter rules to the built-in defaults. It: The command only rewrites the database. It does not rebuild or reload any mail configuration, so the new list is used only when another command or service reads filter.db. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

/go/filter

Examples

# Reset the filter list to the defaults
/go/filter

# Count the rules
sqlite3 /var/lib/sqlite/filter.db "SELECT COUNT(*) FROM Filter"

# Show all rules
sqlite3 /var/lib/sqlite/filter.db "SELECT FilterID, Keyword, Description FROM Filter"

# Back up the current list before resetting
cp /var/lib/sqlite/filter.db /root/filter.db.bak

Output

The command prints nothing and always exits with code 0. To check the result, read the database:

sqlite3 /var/lib/sqlite/filter.db "SELECT COUNT(*) FROM Filter"

Logging

Every run is appended to /var/log/go/filter.log.

The Filter table

Column Type Notes
FilterID Integer, primary key Assigned automatically.
Type Text Always Header for the default rules.
Keyword Text A regular expression of the form .*(?i)<text>. The (?i) makes the match case-insensitive.
Description Text Spam detected or Virus alert.

The pair Type and Keyword must be unique.

See the full reference at /go/filter and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *