Get your free beta license ↗
CMDCommand · run as root on the server · mail family

urbestack-mail-filter-add

First published 3 Oct 20260.1.0Unchanged since publication

Usage

# urbestack-mail-filter-add (--address ADDRESS | --name DOMAIN) --filter-name NAME [--match all|any] --rule FIELD:OP:VALUE [--rule ...] --action ACTION [--position N] [--owner USER]

Description

From the command's --help output
Adds a mail filter to an account (--address) or a domain (--name). Domain filters run before the
filters of each account on that domain. Give the filter a name of up to 64 characters with
--filter-name.

Supply 1 to 20 rules, each with its own --rule in FIELD:OP:VALUE form. FIELD is from, to,
subject, header (any of the usual message headers), or body. OP is contains, not-contains,
equals, begins, ends, or matches. The matches operator uses shell-style patterns with * and ?.
Each VALUE can be up to 256 characters. --match all requires every rule to match and is the
default. --match any requires at least one rule to match.

The folder:NAME action delivers the message to that folder, creates it if needed and ends
filtering for the message. Folder names can be up to 128 characters. The discard action drops
the message. The redirect:ADDRESS action sends a copy to the specified email address and keeps
the original. An account filter must use a destination email address other than the account's
own. The stop action skips the remaining filters in the current list.

Filters run in position order, starting at 1. The new filter goes last by default. Use
--position to insert it at a specific position and shift later filters down. A position past the
end puts it last. If Pigeonhole cannot compile the filter, the command reports Pigeonhole's
error. With --owner, the account or domain must belong to the named customer.

Options

Find other commands that accept these options

Same in the API

This operation runs the command.

More in mail

38 commands, by what they work onView all commands in this family →
urbestack-mail-account-
urbestack-mail-autoresponder-
urbestack-mail-check-
urbestack-mail-dkim-
urbestack-mail-domain-
urbestack-mail-filter-
urbestack-mail-forwarder-
urbestack-mail-greylist-
urbestack-mail-hold-
urbestack-mail-list-
urbestack-mail-queue-
urbestack-mail-settings-
urbestack-mail-smarthost-
Generated from release 0.2.35 (current) · urbestack-mail-filter-add --help outputThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/commands/urbestack-mail-filter-add/