Re: Email::Address::XS
[email protected] Thu, 18 Aug 2016 23:35:10 +0200
| Newsgroups | perl.pep |
|---|---|
| Message-ID | <201608182335.12266@pali> |
On Thursday 18 August 2016 23:21:28 Ricardo Signes wrote:
> > If I create Email::MIME object from input string, I would like to
> > get:
> >
> > 1) Raw (ASCII) string representation of To: field
> >
> > 2) Unicode string representation of To: field
> >
> > 3) List of Email::Address::XS objects which are in To: field
> >
> > 4) List of named groups with Email::Address::XS objects of To:
> > field
> >
> > For 1) and 2) I can use ->header_raw and ->header_str methods. For
> > 3) and 4) are needed new method(s). Ideally if caller is able to
> > get original MIME encoded objects (where in ->phrase part of
> > address object is still MIME encoded) and also if objects strings
> > are Unicode.
>
> As you say, 1 and 2 are dealt with. For 3 or 4, you want to have an
> object in the header slot, rather than a string. Once you've done
> that, you use its methods. If the object's To field stores a
> string, you "upgrade" it with something like:
>
> $email->header(To => mailbox_headers_from( $email->header('To') );
>
> ...and it seems like one would quickly amass some sort of routine
> like:
>
> upgrade_headers($email);
>
> ...that would upgrade all the headers it knows about.
Can you describe (or write code) how you imagine that I get header
"Original-Cc" in form of addresses in list of named groups from email
which is stored in string scalar? I'm not sure that I understand how you
mean it...