Skip Menu |

This queue is for tickets about the Mail-GnuPG CPAN distribution.

Report information
The Basics
Id: 21171
Status: resolved
Priority: 0/
Queue: Mail-GnuPG

People
Owner: Nobody in particular
Requestors: health [...] limasila.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: Robert Spier <rspier [...] cpan.org>
Subject: Mail::GnuPG->mime_signencrypt
Date: Fri, 25 Aug 2006 06:21:50 +1000
To: bug-Mail-GnuPG [...] rt.cpan.org
From: Philip Cook <health [...] limasila.com>
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.

Dear Mail::GnuPG maintainers Can anyone suggest how to both sign and encrypt email from perl. It seems that ->mime_sign($entity) and ->mime_encrypt($entity, @recipients) work when I test it with evolution but for ->mime_signencrypt($entity, @recipients) evolution just reports that the email is encrypted but not signed and encrypted. The code that I am using (with some minor modifications) is; #! /usr/bin/perl use strict; use warnings; use MIME::Entity; use Mail::GnuPG; my $html = <<END_HTML; <p><strong>HTML mail demo</strong> <p>This is the message text <p>It will only be displayed correctly by HTML-capable Mail clients since it has no "text/plain" alternative part. END_HTML my $top = MIME::Entity->build( "To" => "to\@mydomain.com", "From" => "from\@mydomain.com", "Subject" => "Test notify HTML mail", "Type" => "multipart/mixed" ); $top->attach( "Type" => "text/html", "Encoding" => "UTF-8", "Data" => [ $html ] ); my $mg = Mail::GnuPG->new( "keyid" => "99999999", "passphrase" => "secret", "keydir" => "/home/philip/.gnupg" ); my $ret = $mg->mime_signencrypt ($top , "to\@mydomain.com" ); print "ret = $ret\n"; if (!$ret) { $top->smtpsend( "Confirm" => "delivery, reading", "Host" => "mail.mydomain.com.au" ); $top->print(\*STDOUT); } Thanks in advance for your attention and reply to my email Regards Philip Preston, Australia
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #21171] Mail::GnuPG->mime_signencrypt
Date: Sat, 02 Sep 2006 20:25:42 -0700
To: "Philip Cook via RT" <bug-Mail-GnuPG [...] rt.cpan.org>
From: Robert Spier <rspier [...] pobox.com>
Show quoted text
> Can anyone suggest how to both sign and encrypt email from perl. It > seems that ->mime_sign($entity) and ->mime_encrypt($entity, @recipients) > work when I test it with evolution but for ->mime_signencrypt($entity, > @recipients) evolution just reports that the email is encrypted but not > signed and encrypted.
This is not a bug. The signature is _inside_ the encrypted part, and evolution can't see it. If you compare the output of sign and sign_encrypt, you'll see that gpg only says "Good signature" if you use sign_encrypt -R rspier@bear ~$ gpg --decrypt /tmp/2 You need a passphrase to unlock the secret key for user: "Mail::GnuPG Test Key <mail@gnupg.dom>" 1024-bit ELG-E key, ID 9FE08E94, created 2003-10-16 (main key ID EFEA4EAD) gpg: encrypted with 1024-bit ELG-E key, ID 9FE08E94, created 2003-10-16 "Mail::GnuPG Test Key <mail@gnupg.dom>" Content-Type: text/html Content-Disposition: inline Content-Transfer-Encoding: UTF-8 <p><strong>HTML mail demo</strong> <p>This is the message text <p>It will only be displayed correctly by HTML-capable Mail clients since it has no "text/plain" alternative part. gpg: Signature made Sat Sep 2 20:22:25 2006 PDT using DSA key ID EFEA4EAD gpg: Good signature from "Mail::GnuPG Test Key <mail@gnupg.dom>