1 use Mail::DKIM::Signer;
2 use Mail::DKIM::TextWrap; #recommended
5 # default option values
6 my $method = "simple/simple";
8 my $keyfile = "aux-fixed/dkim/dkim.private";
9 my $algorithm = "rsa-sha1";
12 "method=s" => \$method,
13 "selector=s" => \$selector,
14 "keyfile=s" => \$keyfile,
15 "algorithm=s" => \$algorithm,
18 # create a signer object
19 my $dkim = Mail::DKIM::Signer->new(
20 Algorithm => $algorithm,
23 Selector => $selector,
27 # read an email and pass it into the signer, one line at a time
30 # remove local line terminators
34 # use SMTP line terminators
35 $dkim->PRINT("$_\015\012");
39 # what is the signature result?
40 my $signature = $dkim->signature;
41 print $signature->as_string;
44 #print $dkim->headers;