Net::Sieve::Script::Condition(3pm)

Net::Sieve::Script::Condition3pm

Parse and write conditions in sieve scripts

Usage

  use Net::Sieve::Script::Condition;
  my $cond = Net::Sieve::Script::Condition->new('header');
    $cond->match_type(':contains');
    $cond->key_list('"[Test4]"');
    $cond->header_list('"Subject"');
   print $cond->write();

or

   my $cond = Net::Sieve::Script::Condition->new(
     'anyof (
       header :contains "Subject" "[Test]",
           header :contains "Subject" "[Test2]")'
         );
   print $cond->write();

Overview

Parse and write condition part of Sieve rules, see Net::Sieve::Script.

Support RFC 5228, 5231 (relationnal) and regex draft

Constructor

new

Match and set accessors for each condition object in conditions tree, "test" is mandatory

Internal

  id :        id for condition, set by creation order
  condition : array of sub conditions 
  parent :    parent of sub condition
  AllConds :  array of pointers for all conditions

Condition parts
not : 'not' or nothing
test : 'header', 'address', 'exists', ...
key_list : "subject" or ["To", "Cc"]
header_list : "text" or ["text1", "text2"]
address_part : ':all ', ':localpart ', ...
match_type : ':is ', ':contains ', ...
comparator : string part

Methods

equals

 Purpose  : test conditions
 Return   : 1 on equals conditions

write

 Purpose  : write rule conditions in text format
 Return   : multi-line formatted text

Releases

9 releases since Debian 5.0 (Lenny); the text changed 3 times.

  1. 5.0
  2. 6.0–9
  3. 10–11
  4. 12–13

Author

    Yves Agostini
    CPAN ID: YVESAGO
    [email protected]

From libnet-sieve-script-perl 0.09-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.