I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-08-06 11:40:21-07 by mamod
signing multipart alternative messages
Hello, Thanks for the great module, I could sign text/text and text/html messages but couldn't sign multipart/alternative message How I can do that, there is no examples to sign a multipart messages I'm using Mime::lite module to send emails Please help Thank you Mamod
Direct Responses: 11297 | Write a response
Posted on 2009-08-14 12:04:36-07 by jaslong in response to 11248
Re: signing multipart alternative messages

Probably your best bet is to use MIME::Lite to construct the message, then express the entire message as a string. Once it is in string form, you can have Mail::DKIM create a signature for it. Concatenate the signature and the original message, then send it using something other than MIME::Lite.

If you really want to use MIME::Lite to send the message, perhaps something like this will work...

# $msg is the MIME::Lite object ### Prepare the Mail::DKIM object use Mail::DKIM::Signer; my $dkim = Mail::DKIM::Signer->new( Algorithm => "rsa-sha1", Method => "relaxed", Domain => "myhost.com", Selector => "mx1", KeyFile => "./private.key", ); # Mail::DKIM wants the message in the form it is transmitted, i.e. CR-LF line endings my $raw_data = $msg->as_string; $raw_data =~ s/\n/\015\012/gs; $dkim->PRINT($raw_data); $dkim->CLOSE; # Now create the signature my $sig = $dkim->signature; my ($header_name, $header_content) = split /:\s*/, $sig->as_string, 2; # Insert the signature at the beginning of the message (uses an undocumented API of MIME::Lite) unshift @{$msg->{Header}}, [ $header_name, $header_content ]; # Now send the message $msg->send();
Direct Responses: 11321 | 12718 | Write a response
Posted on 2009-08-19 06:23:21-07 by mamod in response to 11297
Re: signing multipart alternative messages
Jason thank you so much, you're awsome :)
my $raw_data = $msg->as_string;
did the trick I wasn't aware of this

Thank you again it took me a month to resolve this and without your help I think I was about to drop the whole issue of signing messages :) Regards, Mamod
Direct Responses: Write a response
Posted on 2010-05-24 14:54:56.629833-07 by dojo in response to 11297
Re: signing multipart alternative messages
Hi I also wish to sign multipart alternative messages and use MIME::Lite. Just wondering what module you recommend using to send the signed message with if not MIME::Lite? Thanks
Direct Responses: Write a response