* Dmitry Bigunyak via RT (bug-MailTools@rt.cpan.org) [091126 10:55]:
Show quoted text> Thu Nov 26 05:55:44 2009: Request 52084 was acted upon.
> Transaction: Ticket created by Alien
> Queue: MailTools
> Subject: Encoded header glued together in one string
> Broken in: 2.04
Show quoted text> Suppose I want to add a new tag to the header with <add> method and the
> value of this tag is encoded, for example:
> To: =?utf-8?B?0KDQsNCx0L7RgtCwIDxkaW1hQGFkcml2ZXIucnU
> +LCBJY2VTdGFyIDxpY2VzdGFyQGluYm94LnJ1?=
> =?utf-8?B?Piwg0J/RgNC40YjQtdC70LXRhiA8YWxpZW4uY29zbW9zQGdtYWlsLmNvbT4=?=
>
> Here are two lines, the second line starts from =?utf-8?B? but sub
> _fold_line removes all new line symbols from the value and I get one
> string. Not all mail clients can parse such result.
First it removes the new-lines, then it breaks the line into separate
parts again, based on some logic.
What I see from your example, is that you lack leading blanks for the
second and third line. You can either specify an unfolded (maybe very
long) line, or a folded line. First the new-lines are removed, but
when these other lines do not start with a blank, these are glued into
on big word.
#!/usr/bin/perl
use warnings;
use strict;
use Mail::Header;
my $h = Mail::Header->new;
$h->add(To =>
'=?utf-8?B?0KDQsNCx0L7RgtCwIDxkaW1hQGFkcml2ZXIucnU
+LCBJY2VTdGFyIDxpY2VzdGFyQGluYm94LnJ1?=
=?utf-8?B?Piwg0J/RgNC40YjQtdC70LXRhiA8YWxpZW4uY29zbW9zQGdtYWlsLmNvbT4=?=');
use Data::Dumper;
warn Dumper $h;
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark@Overmeer.net solutions@overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net