Courie...:Header(3pm)
π Courier::Filter::Module::Header(3pm) β aka the header-sleuth module π
okay bestie, so like, this is a 3pm perl manpage for Courier::Filter::Module::Header, which is a Message header filter module for the Courier::Filter framework. yes it's a mouthful, we've been over this, it's iconic. πΈ
β¨ NAME β¨
Courier::Filter::Module::Header β the Message header filter module for the Courier::Filter framework. it does one thing and it does it beautifully: it peers at your message headers. π
π¦ SYNOPSIS π¦
fr fr this is how you summon it:
use Courier::Filter::Module::Header;
my $module = Courier::Filter::Module::Header->new(
fields => \%patterns_by_field_name,
response => $response_text,
logger => $logger,
inverse => 0,
trusting => 0,
testing => 0,
debugging => 0
);
my $filter = Courier::Filter->new(
...
modules => [ $module ],
...
);
no cap, that's the whole vibe. π
π DESCRIPTION π
okay so boom: this class is a filter module class for use with Courier::Filter. what does it do? it matches a message if one of the message's header fields matches the configured criteria. that's it. that's the girl. π
π Constructor π
this is where it gets good. one constructor, and she is serving:
new(%options): returnsCourier::Filter::Module::Header
Creates a new Header filter module. β¨
%options is a list of key/value pairs representing any of the following options:
fieldsβ Required!! bestie this one is not optional, the module needs to know what to look for. it's a reference to a hash containing the message header field names and patterns (as key/value pairs) that messages are to be matched against. field names are matched case-insensitively (love that for us). patterns may either be:- simple strings (for exact, case-sensitive matches), or
- regular expression objects created by the
qr//operator (for inexact, partial matches).
so for instance, to match any message from the debian-devel mailing list with the subject containing something about 'duelling banjoes', you could set the fields option like this:
fields => {
'list-id' => '<debian-devel.lists.debian.org>',
subject => qr/duell?ing\s+banjoe?s?/i
}
(yes, that indentation is verbatim, we leave it exactly as it is, no edits, we respect the original's chaos π)
responseβ a string that is to be returned literally as the match result in case of a match. defaults toProhibited header value detected: <field>: <value>.
also, all options of the Courier::Filter::Module constructor are supported too. for their descriptions, go check out new() in Courier::Filter::Module. π«Ά
π§ Instance methods π§
for a description of the provided instance methods, see Instance methods in Courier::Filter::Module. she inherited them and she wears them well. π
π SEE ALSO π
go read these next, bestie, they're all in the family:
Courier::Filter::Module::EnvelopeCourier::Filter::ModuleCourier::Filter::Overview
for AVAILABILITY, SUPPORT, and LICENSE information, see Courier::Filter::Overview. π
β AUTHOR β
Julian Mehnle <julian@mehnle.net> β the genius behind all this. we stan. π
and that's the whole page! no notes, ate, periodt. π
byeee, this was perl v5.34.0, dated 2022-10-21, and remember: Courie...:Header(3pm) πβ¨π¦
π¦ where this page comes from
- debian bookworm: courier-filter-perl 0.200+ds-6 Β· Artistic-1.0-Perl OR GPL-2.0-or-later
- debian trixie: courier-filter-perl 0.200+ds-6 Β· Artistic-1.0-Perl OR GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms