|
I found out what I was doing wrong above. I was signing headers that didn't exist:
The below code added to the sender policy fixed things, while making it so I am not signing parts of the header that I shouldn't be:
my $policyfn = sub {
my $dkim = shift;
$headers = join ':', grep { $_ !~ /^(message-id|date|return-path|bounces-to)$/i } (split ':', $dkim->headers);
$dkim->add_signature(
new Mail::DKIM::Signature(
Algorithm => "rsa-sha1",
Method => "relaxed",
Headers => $headers,
Domain => "bearpile.com",
Selector => "mail",
));
return;
};
also,
I need to add a From=>"$from" in the following code:
$msg = MIME::Lite->new(
To =>"$to",
From =>"$from",
Subject =>"testing DKIM via SES",
Type =>'multipart/alternative',
);
I hope this information helps others as I know how frustrating this is, especially when there isn't many examples on the web of altering which headers to use in a sender policy. |