Mail-DKIM-Iterator
view release on metacpan or search on metacpan
lib/Mail/DKIM/Iterator.pm view on Meta::CPAN
use v5.10.0;
our $VERSION = '1.011';
use strict;
use warnings;
use Crypt::OpenSSL::RSA;
use Scalar::Util 'dualvar';
# critical header fields which should be well protected
my @critical_headers = qw(from subject content-type content-transfer-encoding);
my $critical_headers_rx = do {
my $rx = join("|",@critical_headers);
qr{$rx}i;
};
# all header fields which should be included in the signature
my @sign_headers = (@critical_headers, 'to', 'cc', 'date');
use Exporter 'import';
our @EXPORT = qw(
DKIM_POLICY
lib/Mail/DKIM/Iterator.pm view on Meta::CPAN
=head1 SECURITY
The protection offered by DKIM can be easily be weakened by using insufficient
header protection in the C<h> attribute of the signature of by using the C<l>
attribute and having data which are not covered by the body hash.
C<Mail::DKIM::Iterator> will warn if it detects insufficent protection inside
the DKIM signature, i.e. if critical headers are not signed or if the body has
non-white-space data not covered by the body hash. Check the C<warning> function
on the result to get these warnings.
As critical are considered from, subject, content-type and
content-transfer-encoding since changes to these can significantly change the
interpretation of the mail by the MUA or user.
When signing C<Mail::DKIM::Iterator> will also protect all critical headers
against modification and adding extra fields as described in RFC 6376 section
8.15. In addition to the critical headers checked when validating a signature it
will also properly protect C<to> and C<cc> by default.
=head1 SEE ALSO
( run in 2.435 seconds using v1.01-cache-2.11-cpan-d7f47b0818f )