← 返回命令列表

Linux command

sieve 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Compile and check

sieve --compile-only [path/to/script.sieve]

Compile and dump

sieve --dump [path/to/script.sieve]

Run a Sieve script

sieve [path/to/script.sieve] [path/to/mailbox]

Filter with verbose output

sieve --verbose [path/to/script.sieve] [path/to/mailbox]

Set debug level

sieve --debug=[trace4] [path/to/script.sieve]

说明

sieve is a mail filtering tool that processes email using scripts written in the Sieve language (RFC 5228). Sieve is a domain-specific language designed for filtering email messages at delivery time, supporting actions like filing messages into folders, discarding spam, forwarding, and vacation responses. The Sieve language provides conditional branching and pattern matching on message headers and content, but intentionally lacks variables and loops in its base specification to prevent runaway programs. Extensions to the base standard add features like variables, include files, and advanced string manipulation. sieve can compile scripts to check for errors without executing them, or process actual mailboxes. It's commonly used with mail servers like Dovecot (via Pigeonhole) or GNU Mailutils.

参数

-c, --compile-only
Compile the script and exit without executing. Used for syntax checking.
-D, --dump
Compile the script and dump disassembled Sieve code to the terminal.
-v, --verbose
Increase verbosity level.
--debug=_level_
Set debugging level. Sieve-specific levels: trace1 (parse tree before optimization), trace2 (parse tree after optimization), trace3 (parser traces), trace4 (tests and actions executed), trace9 (each instruction executed).
--no-compile-only
Execute the script (disable compile-only mode).
-h, --help
Display help information.
--version
Display version information.

FAQ

What is the sieve command used for?

sieve is a mail filtering tool that processes email using scripts written in the Sieve language (RFC 5228). Sieve is a domain-specific language designed for filtering email messages at delivery time, supporting actions like filing messages into folders, discarding spam, forwarding, and vacation responses. The Sieve language provides conditional branching and pattern matching on message headers and content, but intentionally lacks variables and loops in its base specification to prevent runaway programs. Extensions to the base standard add features like variables, include files, and advanced string manipulation. sieve can compile scripts to check for errors without executing them, or process actual mailboxes. It's commonly used with mail servers like Dovecot (via Pigeonhole) or GNU Mailutils.

How do I run a basic sieve example?

Run `sieve --compile-only [path/to/script.sieve]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c, --compile-only do in sieve?

Compile the script and exit without executing. Used for syntax checking.