Net::S...ndition(3pm)
π Net::Sieve::Script::Condition π
okay bestie, gather round, because this is the Net::Sieve::Script::Condition page from the User Contributed Perl Documentation, and it's literally the little gremlin that handles the condition part of your sieve scripts. it parses them, it writes them, it's giving parser-and-writer energy. π¦
β¨ NAME β¨
Net::Sieve::Script::Condition β parse and write conditions in sieve scripts. that's it, that's the whole job, and she does it flawlessly. π
πΈ SYNOPSIS πΈ
here's the vibe, copy-paste ready:
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, if you're feeling spicy and want to hand her a whole blob of text instead:
my $cond = Net::Sieve::Script::Condition->new(
'anyof (
header :contains "Subject" "[Test]",
header :contains "Subject" "[Test2]")'
);
print $cond->write();
both? valid. iconic? yes. π
π DESCRIPTION π
she parses and writes the condition part of Sieve rules β go look at Net::Sieve::Script for the bigger picture, bestie, she's part of a whole ensemble. π«Ά
she supports RFC 5228, 5231 (that's the relationnal one, spelling straight from the source, no notes) and the regex draft. no cap. π₯
π§ CONSTRUCTOR π§
π new π
matches and sets accessors for each condition object in the conditions tree, and heads up: test is mandatory. you cannot skip it. she will not let you skip it. periodt. π
Internal stuff (iykyk):
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 (the actual lewks she can serve):
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
look at all those little parts. obsessed. β¨
π METHODS π
β equals β
Purpose : test conditions
Return : 1 on equals conditions
she checks if conditions match up. returns 1 when they're equals. simple, clean, slay. πΈ
π¦ write π¦
Purpose : write rule conditions in text format
Return : multi-line formatted text
she writes your rule conditions out as text and hands you back multi-line formatted text. chef's kiss. π
π AUTHOR π
Yves Agostini
CPAN ID: YVESAGO
yvesago@cpan.org
shoutout to Yves, the actual author, the main character. π
π COPYRIGHT π
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
the full text of the license can be found in the LICENSE file included with this module. go read it bestie, it's right there. π
and that's the whole page!! this was written against perl v5.34.0, dated 2022-06-30, and yes the manual name is Net::S...ndition(3pm) because the header truncated it like that and we respect the bit. bye babe, go parse some conditions πβ¨π¦
π¦ where this page comes from
- debian bookworm: libnet-sieve-script-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnet-sieve-script-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-sieve-script-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-sieve-script-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-sieve-script-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms