This is the code form my small test script:
#! /usr/bin/perl use strict; use warnings; use Mail::DKIM::Verifier; my $raw_email; my $dkim = Mail::DKIM::Verifier->new(); open (MESSAGE, "< $ARGV[0]") || die "Couldn't open email $ARGV[0]\n"; undef $/; $raw_email = <>; close MESSAGE; print "$ARGV"; open(my $fh, "<", "$ARGV") or die "Can't open < $ARGV: $!"; $dkim->load($fh); my $result = $dkim->result; print "\n$result"; foreach my $signature ($dkim->signatures) { print "signature identity: " . $signature->identity . "\n"; print "verify result: " . $signature->result_detail . "\n"; }
I have tested this script with differed emails. Test files with correct, wrong and missing DKIM signature. The script returns always "none" (my $result = $dkim->result;) and $signature is an empty variable.
It seams that this script canīt find a DKIM signature in the test files.
In reply to Re^2: Filehandle with DKIM::Verifier
by nifu
in thread Filehandle with DKIM::Verifier
by nifu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |