.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Net::Sieve::Script::Rule 3pm" .TH Net::Sieve::Script::Rule 3pm "2017-09-30" "perl v5.26.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::Sieve::Script::Rule \- parse and write rules in sieve scripts .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 7 \& use Net::Sieve::Script::Rule; \& my $pRule = Net::Sieve::Script::Rule\->new ( \& ctrl => $ctrl, \& test_list => $test_list, \& block => $block, \& order => $order \& ); .Ve .PP or my \f(CW$rule\fR = Net::Sieve::Script::Rule\->\fInew()\fR; my \f(CW$cond\fR = Net::Sieve::Script::Condition\->new('header'); \f(CW$cond\fR\->match_type(':contains'); \f(CW$cond\fR\->header_list('\*(L"Subject\*(R"'); \f(CW$cond\fR\->key_list('\*(L"Re: Test2\*(R"'); my \f(CW$actions\fR = 'fileinto \*(L"\s-1INBOX\s0.test\*(R"; stop;'; .PP .Vb 2 \& $rule\->add_condition($cond); \& $rule\->add_action($actions); \& \& print $rule\->write; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .SS "new" .IX Subsection "new" .Vb 7 \& Arguments : \& order => : optional set priority for rule \& ctrl => : optional default \*(Aqif\*(Aq, else could be \*(Aqelse\*(Aq, \*(Aqelsif\*(Aq \& or \*(Aqvacation\*(Aq \& test_list => : optional conditions by string or by Condition Object \& block => : optional block of commands \& Returns : Net::Sieve::Script::Rule object .Ve .PP Set accessors .PP .Vb 5 \& alternate : as param ctrl \& conditions : first condition in tree \& actions : array of actions objects \& priority : rule order in script, main id for rule \& require : .Ve .SH "METHODS" .IX Header "METHODS" .SS "equals" .IX Subsection "equals" return 1 if rules are equals .SS "write" .IX Subsection "write" .Vb 1 \& Return rule in text format .Ve .SS "write_condition" .IX Subsection "write_condition" .Vb 2 \& set require for used conditions \& return conditions in text format .Ve .SS "write_action" .IX Subsection "write_action" .Vb 2 \& set require for used actions \& return actions in text format .Ve .SS "delete_condition" .IX Subsection "delete_condition" .Vb 4 \& Purpose : delete condition by rule, delete all block on delete anyof/allof \& delete single anyof/allof block : single condition move up \& Arguments : condition id \& Returns : 1 on success, 0 on error .Ve .SS "add_condition" .IX Subsection "add_condition" .Vb 3 \& Purpose : add condition to rule, add \*(Aqallof\*(Aq group on second rule \& Arguments : string or Condition object \& Returns : new condition id or 0 on error .Ve .SS "swap_actions" .IX Subsection "swap_actions" .Vb 2 \& swap actions by order \& return 1 on succes, 0 on failure .Ve .SS "find_action" .IX Subsection "find_action" .Vb 2 \& find action by order \& Returns: Net::Sieve::Script::Action object, 0 on error .Ve .SS "delete_action" .IX Subsection "delete_action" delete action by order, first is 1; .SS "add_action" .IX Subsection "add_action" .Vb 5 \& Purpose : add action at end of block \& Arguments : command line \& or command line list with ; separator \& or Net::Sieve::Script::Action object \& Return : 1 on success .Ve .SH "AUTHOR" .IX Header "AUTHOR" .Vb 3 \& Yves Agostini \& CPAN ID: YVESAGO \& yvesago@cpan.org .Ve .SH "COPYRIGHT" .IX Header "COPYRIGHT" This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP The full text of the license can be found in the \&\s-1LICENSE\s0 file included with this module.