Courie...:Header(3pm)

πŸ“¦
version 0.200 Β· 2 versions
, in debian bookworm, debian trixie

πŸ’– 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): returns Courier::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 to Prohibited 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::Envelope
  • Courier::Filter::Module
  • Courier::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