Tests

Tests act as block gatekeepers. They check whether a certain condition in the policy script is met. A test is positioned with a control command before the opening brace in a block to determine whether the policy actions should execute. If a condition is met, the test is "true" and the actions within the block execute. If the test fails, the condition is "false" and no actions will execute for that particular policy.

Generic Example:
if test {
    action;
    next_action;
}
Policy Script Example:
if pmx_virus {
    reject "Virus Found in Message";
    stop;
}

In this example, a message must pass the pmx-virus test before the actions in the block can execute. If the test is "true" and the message contains a virus, the message is rejected and the policy script stops filtering the message. If the message does not contain a virus, the test fails and no actions from the block will execute.