Courie...akeDate(3pm)

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

πŸ’– Courier::Filter::Module::FakeDate(3pm) πŸ’–

ok so this is a page from the User Contributed Perl Documentation, and bestie, we are about to learn about the FakeDate module β€” a fake "Date:" message header filter module for the Courier::Filter framework. yes the header of the page got chopped down to Courie...akeDate(3pm) by the terminal, we don't talk about that. πŸŽ€


✨ NAME ✨

Courier::Filter::Module::FakeDate β€” a fake "Date:" message header filter module, living its best life inside the Courier::Filter framework. πŸ•°οΈ


🌸 SYNOPSIS 🌸

use Courier::Filter::Module::FakeDate;

my $module = Courier::Filter::Module::Header->new(
    forward_tolerance   => {
        # years, months, weeks, days, hours, minutes, seconds
        hours       => 2
    },
    backward_tolerance  => {
        # years, months, weeks, days, hours, minutes, seconds
        days        => 5
    },

    ignore_unparseable  => 0,

    logger      => $logger,
    inverse     => 0,
    trusting    => 0,
    testing     => 0,
    debugging   => 0
);

my $filter = Courier::Filter->new(
    ...
    modules     => [ $module ],
    ...
);

like. look at that. gorgeous. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so this class is a filter module class meant to be used with Courier::Filter. what does it do? it matches a message if that message has a "Date" header field that is sitting too far in the future or in the past, measured against the local system's time. ⏰

and here's the lil plot twist: if the message has a "Resent-Date" header field (peep RFC 2822, 3.6.6 πŸ‘€), then that one gets examined instead β€” bc the message could just be an old one that somebody recently re-sent, and honestly? that's perfectly legitimate behavior. we respect it. 🫢

when it does match, the response politely informs the sender that their "Date" header is implausible and that they should maybe, idk, check their clock. 😭

Note: times in different time zones are compared correctly. no cap. 🌍
Note: when you're running this filter module, it is essential that the local system's own clock is set correctly β€” otherwise there's an increased risk of legitimate messages getting rejected. so like. ntp is your bestie. πŸ’…

πŸ‘‘ Constructor

the following constructor is provided:

  • new(%options): returns Courier::Filter::Module::FakeDate β€” creates a new FakeDate filter module. slay.

%options is a list of key/value pairs representing any of the following options:

  • forward_tolerance
  • backward_tolerance β€” the maximum durations by which a message's "Date" or "Resent-Date" header may diverge into the future and the past, respectively, from the local system's time. each duration has to be specified as a hash-ref containing one or more time units and their respective quantity/ies, exactly as specified by DateTime::Duration. "forward_tolerance" defaults to 2 hours. "backward_tolerance" defaults to 5 days, to account for transmission delays. (yes it really does say that. iconic.)

for example:

forward_tolerance  => { hours => 4 },
backward_tolerance => { days  => 1, hours => 12 }
  • ignore_unparseable β€” a boolean value controlling whether messages whose "Date" or "Resent-Date" header does not loosely conform to RFCs 822 or 2822 should be ignored (true) or matched (false). defaults to false. πŸ™ˆ

all options of the Courier::Filter::Module constructor are also supported. please see "new" in Courier::Filter::Module for their descriptions. πŸ’œ

🧚 Instance methods

see "Instance methods" in Courier::Filter::Module for a description of the provided instance methods. that's it. that's the section. ✨


🌈 SEE ALSO 🌈

  • Courier::Filter::Module
  • Courier::Filter::Overview

for AVAILABILITY, SUPPORT, and LICENSE information, see Courier::Filter::Overview. πŸ“š


⭐ AUTHOR ⭐

Julian Mehnle <julian@mehnle.net> β€” thank you for your service bestie πŸ«‘πŸ’–


and that's the whole page!! this doc shipped as part of perl v5.34.0, dated 2022-10-21, and it was served up in that classic User Contributed Perl Documentation style. mwah. πŸ’‹ no notes. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from