App-Eduard

 view release on metacpan or  search on metacpan

lib/App/Eduard.pm  view on Meta::CPAN

		$msg = $parser->parse_data($msg->stringify)
	}

	my $gpg = mg;
	if ($msg->effective_type ne 'multipart/signed' && $msg->effective_type ne 'multipart/encrypted' && !$msg->bodyhandle) {
		debug 'This is (probably) a PGP/Inline mail with attachments. Working around...';
		$msg = find_pgp_part $msg, $gpg
	}

	if ($gpg->is_signed($msg)) {
		debug 'This mail looks signed';
		my ($code, $keyid, $email) = $gpg->verify($msg);
		return sign_error => (
			message => stringify $gpg->{last_message}) if $code;
		return sign => (
			keyid   => $keyid,
			email   => $email,
			message => stringify $gpg->{last_message});
	}

	if ($gpg->is_encrypted($msg)) {
		debug 'This mail looks encrypted';
		my ($code, $keyid, $email) = $gpg->decrypt($msg);
		return encrypt_error => (
			message   => stringify $gpg->{last_message}) if $code;
		return encrypt => (
			plaintext => stringify $gpg->{plaintext},
			decrypted => $gpg->{decrypted},
			message   => stringify $gpg->{last_message}) unless defined $keyid;
		return signencrypt => (
			keyid     => $keyid,
			email     => $email,



( run in 0.445 second using v1.01-cache-2.11-cpan-64827b87656 )