Administrative Hinweise zu Qmail, Filter für .qmail

CONDEXECUTE


NAME

condexecute -- forward an incoming message under certain conditions

SYNOPSIS

condexecute delimiter forward command delimiter condition command

DESCRIPTION

condexecute expects on its standard input a seekable file that contains a message. This is the case if condexecute is invoked in a dot-qmail environment.

This message is passed to condition command for evaluation. If condition command exits 0, the message is passed on to forward command. If condition command exits 111, condexecute exits 111 as well to indicate a temporary error. If condition command exits anything else, condexecute exits 0 and allows further execution of ~/.qmail.

If forward command is executed and exits 0, condexecute exits 99 to avoid further execution of ~/.qmail. If forward command exits 111, condexecute executes with 111 as well. If forward command exits anything else, condexecute exits 0 and allows further execution of ~/.qmail.

To allow a separation of forward command from condition command, a delimiter has to be used. Any symbol is fine as long it does not appear as separate argument token within forward command.

EXAMPLE

Following example delivers all incoming messages with a header indicating a message from john to the mail directory mailbox/john. Note that X has been used as a delimiter:

   condexecute X preline -f maildirdeliver ./mailbox/john/ X \
      ifheader 'From: john@example.com'

Note that within ~/.qmail the entire command has to be put into a single line without a \f(CW\.

SEE ALSO

This is similar to condredirect execpt that condexecute takes a general forward command instead of a forwarding address.

AUTHOR

Andreas Borchert
converted to HTML: 2006/03/29