|
NAMEMail::BIMI - BIMI object VERSIONversion 3.20250130 DESCRIPTIONBrand Indicators for Message Identification (BIMI) retrieval, validation, and processing SYNOPSIS # Assuming we have a message, and have verified it has exactly one From Header domain, and passes
# any other BIMI and local site requirements not related to BIMI record validation...
# For example, relevant DKIM coverage of any BIMI-Selector header
my $message = ...Specifics of adding headers and Authentication-Results is left to the reader...
my $domain = "example.com"; # domain from From header
my $selector = "default"; # selector from From header
my $spf = Mail::SPF->new( ...See Mail::SPF POD for options... );
my $dmarc = Mail::DMARC::PurePerl->new( ...See Mail::DMARC POD for options... );
$dmarc->validate;
my $bimi = Mail::BIMI->new(
dmarc_object => $dmarc,
spf_object => $spf,
domain => $domain,
selector => $selector,
);
my $auth_results = $bimi->get_authentication_results_object;
my $bimi_result = $bimi->result;
$message->add_auth_results($auth_results); # See Mail::AuthenticationResults POD for usage
if ( $bimi_result->result eq 'pass' ) {
my $headers = $result->headers;
if ($headers) {
$message->add_header( 'BIMI-Location', $headers->{'BIMI-Location'} if exists $headers->{'BIMI-Location'};
$message->add_header( 'BIMI-Indicator', $headers->{'BIMI-Indicator'} if exists $headers->{'BIMI-Indicator'};
}
}
INPUTSThese values are used as inputs for lookups and verifications, they are typically set by the caller based on values found in the message being processed dmarc_objectis=rw Validated Mail::DMARC::PurePerl object from parsed message domainis=rw Domain to lookup/domain record was retrieved from resolveris=rw Net::DNS::Resolver object to use for DNS lookups; default used if not set selectoris=rw Selector to lookup/selector record was retrieved from spf_objectis=rw Mail::SPF::Result object from parsed message ATTRIBUTESThese values are derived from lookups and verifications made based upon the input values, it is however possible to override these with other values should you wish to, for example, validate a record before it is published in DNS, or validate an Indicator which is only available locally dmarc_pp_objectis=rw Relevant Mail::DMARC::PurePerl object dmarc_result_objectis=rw Relevant Mail::DMARC::Result object errorsis=rw optionsis=rw Options class recordis=rw Mail::BIMI::Record object resultis=rw Mail::BIMI::Result object timeis=ro time of retrieval - useful in testing warningsis=rw CONSUMES
EXTENDS
METHODSfinish()Finish and clean up, write cache if enabled. log_verbose()Output given text if in verbose mode. REQUIRES
AUTHORMarc Bradshaw <marc@marcbradshaw.net> COPYRIGHT AND LICENSEThis software is copyright (c) 2020 by Marc Bradshaw. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
|