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";
11 "method=s" => \$method,
12 "selector=s" => \$selector,
13 "keyfile=s" => \$keyfile,
16 # create a signer object
17 my $dkim = Mail::DKIM::Signer->new(
18 Algorithm => "rsa-sha1",
21 Selector => $selector,
25 # read an email and pass it into the signer, one line at a time
28 # remove local line terminators
32 # use SMTP line terminators
33 $dkim->PRINT("$_\015\012");
37 # what is the signature result?
38 my $signature = $dkim->signature;
39 print $signature->as_string;
42 #print $dkim->headers;