NAME
Mail::MIMEDefang::BIMI - Brand Indicators for Message Identification support for MIMEDefang
DESCRIPTION
Mail::MIMEDefang::BIMI provides methods to look up and verify BIMI DNS records from mimedefang-filter. BIMI (Brand Indicators for Message Identification) allows domain owners to publish a verified logo that mail clients can display alongside authenticated messages.
A BIMI record is only considered valid when the sending domain passes DMARC at enforcement level (p=quarantine or p=reject).
When the Mail::BIMI Perl module (version 3.x or later) is installed, md_bimi_lookup and md_bimi_verify use it for richer validation, including SVG logo integrity and Verified Mark Certificate (VMC) chain verification. Without Mail::BIMI the checks are limited to DNS record existence and a non-empty l= tag.
METHODS
- md_init
-
Detect and load
Mail::BIMIif installed, setting$Features{"Mail::BIMI"}. Called automatically bydetect_and_load_perl_modulesinMail::MIMEDefang. - md_bimi_get_selector($entity)
-
Extract the BIMI selector from the
BIMI-Selectorheader of aMIME::Entityobject. The header format is:BIMI-Selector: v=BIMI1; s=brand1;Returns the selector string (e.g.
"brand1") on success, or"default"when the header is absent, malformed, or$entityis undefined.Typical usage in
filter_begin($entity):my $selector = md_bimi_get_selector($entity); my $result = md_bimi_verify($domain, $dmarc_result, $policy, $selector); - md_bimi_lookup($domain [, $selector])
-
Look up the BIMI DNS TXT record for
$domain.The optional
$selectorargument specifies which BIMI selector to query (e.g."brand1"→brand1._bimi.$domain). When omitted orundef,"default"is used. Usemd_bimi_get_selectorto derive the selector from the message'sBIMI-Selectorheader.Returns a hashref with the following keys on success:
version-
Always
BIMI1. l-
The URL of the SVG logo (
l=tag). a-
The URL of the Verified Mark Certificate (
a=tag), if present. raw-
The raw TXT record string.
Returns
undefif no BIMI record is found or ifNet::DNSis not available. - md_bimi_verify($domain, $dmarc_result, $dmarc_policy [, $selector])
-
Verify that a domain's BIMI record is valid given the DMARC result.
BIMI is only considered to pass when:
A BIMI DNS record exists for
$domain.$dmarc_resultispass.$dmarc_policyisquarantineorreject(enforcement level).The BIMI record contains a non-empty
l=(logo URL) tag.
Returns
"pass"on success,"fail"otherwise.The method accepts the following parameters:
$domain-
The sender's domain (From: header domain).
$dmarc_result-
The DMARC result string, e.g.
"pass"or"fail". $dmarc_policy-
The DMARC policy in effect:
"none","quarantine", or"reject". $selector-
Optional BIMI selector string. Defaults to
"default". Pass the value returned bymd_bimi_get_selector($entity)to honour the message'sBIMI-Selectorheader.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 107:
Non-ASCII character seen before =encoding in '→'. Assuming UTF-8