Pipe test

From Mailutils
Jump to navigationJump to search

Pipe is a Sieve extension test.


  pipe [:envelope] [:header] [:body] 
       [:exit <code: number>] [:signal <sig: number>]
       <program: string>

The pipe test executes a shell command specified by program and pipes the entire message, including its envelope, to its standard input.

Piping only certain parts of the message can be requested by supplying corresponding tagged arguments. For example

  pipe :envelope :body "prog"

will send to prog only envelope and body of each message.

The test evaluates to True if program terminated with the code equal to code, or, if it terminated on a signal, if the number of the signal that caused its termination equals to sig.

If :exit tagged argument is not given, code defaults to 0.

If the program terminates on signal and :signal is not given, error is reported and execution of the script is aborted.

See also