"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "scripts/dkimverify.pl" between
Mail-DKIM-1.20220408.tar.gz and Mail-DKIM-1.20220520.tar.gz

About: Mail-DKIM Perl module for implementing the DKIM (DomainKeys Identified Mail) message-signing and verifying standard for Internet mail.

dkimverify.pl  (Mail-DKIM-1.20220408):dkimverify.pl  (Mail-DKIM-1.20220520)
skipping to change at line 13 skipping to change at line 13
# Copyright (c) 2005-2007 Messiah College. This program is free software. # Copyright (c) 2005-2007 Messiah College. This program is free software.
# You can redistribute it and/or modify it under the terms of the # You can redistribute it and/or modify it under the terms of the
# GNU Public License as found at http://www.fsf.org/copyleft/gpl.html. # GNU Public License as found at http://www.fsf.org/copyleft/gpl.html.
# #
# Written by Jason Long, jlong@messiah.edu. # Written by Jason Long, jlong@messiah.edu.
use strict; use strict;
use warnings; use warnings;
use Mail::DKIM::Verifier; use Mail::DKIM::Verifier;
use Getopt::Long; use Getopt::Long::Descriptive;
my $debug_canonicalization; my ($opt, $usage) = describe_options(
GetOptions( "%c %o < original_email.txt",
"debug-canonicalization=s" => \$debug_canonicalization, [ "debug-canonicalization=s" => "Output canonicalized message to file for DKIM
) debugging" ],
or die "Error: invalid argument(s)\n"; [ "help|?" => "Show help" ],
{show_defaults=>1},
);
if ($opt->help) {
print $usage->text;
exit 1;
}
my $debugfh; my $debugfh;
if (defined $debug_canonicalization) if (defined $opt->debug_canonicalization)
{ {
open $debugfh, ">", $debug_canonicalization open $debugfh, ">", $opt->debug_canonicalization
or die "Error: cannot write to $debug_canonicalization: $!\n"; or die "Error: cannot write to ".$opt->debug_canonicalization.":
$!\n";
} }
# recommended, but may cause compatibility problems with old firewalls # recommended, but may cause compatibility problems with old firewalls
Mail::DKIM::DNS::enable_EDNS0; Mail::DKIM::DNS::enable_EDNS0;
my $dkim = new Mail::DKIM::Verifier( my $dkim = new Mail::DKIM::Verifier(
Debug_Canonicalization => $debugfh, Debug_Canonicalization => $debugfh,
); );
while (<STDIN>) while (<STDIN>)
{ {
chomp; chomp;
s/\015$//; s/\015$//;
$dkim->PRINT("$_\015\012"); $dkim->PRINT("$_\015\012");
} }
$dkim->CLOSE; $dkim->CLOSE;
if ($debugfh) if ($debugfh)
{ {
close $debugfh; close $debugfh;
print STDERR "wrong canonicalized message to $debug_canonicalization\n"; print STDERR "wrong canonicalized message to ".$opt->debug_canonicalizati on."\n";
} }
print "originator address: " . $dkim->message_originator->address . "\n"; print "originator address: " . $dkim->message_originator->address . "\n";
foreach my $signature ($dkim->signatures) foreach my $signature ($dkim->signatures)
{ {
print "signature identity: " . $signature->identity . "\n"; print "signature identity: " . $signature->identity . "\n";
print "verify result: " . $signature->result_detail . "\n"; print "verify result: " . $signature->result_detail . "\n";
} }
foreach my $policy ($dkim->policies) foreach my $policy ($dkim->policies)
skipping to change at line 79 skipping to change at line 85
=head1 SYNOPSIS =head1 SYNOPSIS
dkimverify.pl [options] < signed_email.txt dkimverify.pl [options] < signed_email.txt
options: options:
--debug-canonicalization=FILE --debug-canonicalization=FILE
dkimverify.pl --help dkimverify.pl --help
to see a full description of the various options to see a full description of the various options
=head1 OPTIONS
=over
=item B<--debug-canonicalization>
Outputs the canonicalized message to the specified file, in addition
to computing the DKIM signature. This is helpful for debugging
canonicalization methods.
=back
=head1 AUTHOR =head1 AUTHOR
Jason Long, E<lt>jlong@messiah.eduE<gt> Jason Long, E<lt>jlong@messiah.eduE<gt>
Marc Bradshaw, E<lt>marc@marcbradshaw.netE<gt>
=head1 COPYRIGHT AND LICENSE =head1 COPYRIGHT AND LICENSE
Copyright (C) 2006-2007 by Messiah College Copyright (C) 2006-2007 by Messiah College
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.6 or, it under the same terms as Perl itself, either Perl version 5.8.6 or,
at your option, any later version of Perl 5 you may have available. at your option, any later version of Perl 5 you may have available.
=cut =cut
 End of changes. 7 change blocks. 
22 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)