tags 637222 patch
thanks

IMHO an argument against fixing the issue in Mail::Mailer directly is
that the Q-Encoding of the headers is typically done when constructing
the MIME::Entity object.  Mail::Mailer extracts the envelope from/to
from the header (or delegated the extraction to eg, sendmail(1)), hence
if it were to take care of the conversion of the envelope to ASCII,
I don't see why it shouldn't perform the Q-Encoding as well.  Maybe it
should do both, but doing complex massaging of the headers seems to be
beyond what it does at the moment.

Anyway, the enclosed patch, to be applied on top of that posted to #659971

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659971#17

forces caff to convert addresses to ASCII when constructing the 
MIME::Entity object, and as far as I can tell, solves the problem with 
Internalized Domain Names.

Cheers,
-- 
Guilhem.
diff -ru a/caff/caff b/caff/caff
--- a/caff/caff
+++ b/caff/caff
@@ -322,6 +322,7 @@
 use MIME::Entity;
 use Encode;
 use I18N::Langinfo;
+use Net::IDN::Encode qw{email_to_ascii};
 use Fcntl;
 use IO::Select;
 use Getopt::Long;
@@ -521,6 +522,8 @@
 	my $locale = Encode::find_encoding(langinfo(I18N::Langinfo::CODESET()));
 	if (defined $locale) {
 		$CONFIG{$_} = $locale->decode($CONFIG{$_}) for qw/owner mail-template/;
+		$CONFIG{$_} = email_to_ascii($locale->decode($CONFIG{$_}))
+			for grep {defined $CONFIG{$_}} qw/email bcc reply-to/;
 	}
 };
 
@@ -874,7 +877,7 @@
 	};
 
 	$message_entity->head->add("Subject", "Your signed PGP key 0x$key_id");
-	$message_entity->head->add("To", $address);
+	$message_entity->head->add("To", email_to_ascii(Encode::decode('utf-8', $address)));
 	$message_entity->head->add("From", '"'.Encode::encode('MIME-Q', $CONFIG{'owner'}).'" <'.$CONFIG{'email'}.'>');
 	$message_entity->head->add("Sender", '"'.Encode::encode('MIME-Q', $CONFIG{'owner'}).'" <'.$CONFIG{'email'}.'>');
 	$message_entity->head->add("Reply-To", $CONFIG{'reply-to'}) if defined $CONFIG{'reply-to'};
diff -ru a/caff/README b/caff/README
--- a/caff/README
+++ b/caff/README
@@ -34,7 +34,8 @@
 ------------
 
  gnupg (>= 1.3.92), perl, libgnupg-interface-perl,
- libtext-template-perl, libmime-perl, libmailtools-perl (>= 1.62)
+ libtext-template-perl, libmime-perl, libmailtools-perl (>= 1.62),
+ libnet-idn-encode-perl
 
 INSTALLATION
 ------------
diff -ru a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,8 @@
 Architecture: any
 Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, gnupg,
  libgnupg-interface-perl, libtext-template-perl, libmime-tools-perl,
- libmailtools-perl, libterm-readkey-perl, libclass-methodmaker-perl, qprint
+ libmailtools-perl, libterm-readkey-perl, libclass-methodmaker-perl,
+ libnet-idn-encode-perl, qprint
 Recommends: default-mta | mail-transport-agent, libpaper-utils,
  libgd-gd2-noxpm-perl | libgd-gd2-perl,
  libtext-iconv-perl | libintl-perl | recode, dialog | whiptail

Attachment: signature.asc
Description: Digital signature

Reply via email to