Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > perl.pep > #8

Re: Email::Address::XS

Newsgroups perl.pep
Date 2016-07-03 19:52 -0400
Subject Re: Email::Address::XS
Message-ID <20160703235241.GA26626@debian> (permalink)
References <201605231905.43786@pali> <201606011844.08148@pali> <20160701005131.GA27257@debian> <201607031439.41051@pali>
From perl.pep@rjbs.manxome.org (Ricardo Signes)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

* pali@cpan.org [2016-07-03T08:39:22]
> On Friday 01 July 2016 02:51:31 Ricardo Signes wrote:
> 
> > What if we defined a role (here, just a well-known name) called
> > Email::MIME::Header::Value, which is used to signal that a particular
> > method, say "as_mime_header", should be used to stringify?
> 
> In this case, do we need role at all? Is not existence of method 
> "as_mime_header" enough?

That method alone is fine with me.

> And all this would be passed via header or header_str?

I'd stick to header_str, I think, but I'm not sure.  At any rate: yes.

> If address(), addrlist() and addrgroup() returns those objects (with 
> as_mime_header() method) it could be usable...
> 
> But I was thinking about using same syntax in Email::MIME for passing 
> addrlist/addrgroup as is in Email::Address::XS format_email_addresses 
> and format_email_groups functions.

I'm afraid I don't understand what you mean.

> In my opinion folding and unfolding should be done in Email::Simple. I'm 
> not huge fan of adding folding and CRLF code into Email::Address::XS as 
> it has nothing to do with it. That module parse and format one line of 
> list of addresses.

I agree.  I think if we start with the API described above, and leave the
folding for the message to perform, we'll be okay.  We can certainly find out
by writing the code!

> > What do you think of this all?
> 
> Still do not know how to handle non-MIME headers correctly in 
> Email::MIME module. We can either create blacklist of non-MIME headers 
> and extend it every time when somebody report problem or create 
> whitelist of MIME headers... Or let caller to decide if his header must 
> be MIME-encoded or not.

I'm sorry, I don't understand.  Could you elaborate?

> Basically we need unambiguous way to specify:
> 
> * ascii string which will never be MIME-encoded (error for unicode char)
> * unicode string which will be MIME-encoded if contains unicode char
> * addresses/groups - but again with ability to specify if do MIME-encode

We have that, right?

"header" is "already encoded", which is another way of saying "do not encode
this."

"header_str" is "text string" which means it will get encoded.

The address or groups thing falls under "object."  I had assumed it would,
itself, know how to become MIME encoded.  This is important, because the
semantics of what gets encoded differ per field type.  So, as_mime_header is
the encoded form.  If you want to offer an unencoded form, as_string seems like
the obvious method.

-- 
rjbs

Back to perl.pep | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Email::Address::XS pali@cpan.org - 2016-05-23 19:05 +0200
  Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-05-28 16:33 -0400
    Re: Email::Address::XS pali@cpan.org - 2016-05-28 22:48 +0200
      Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-05-30 20:42 -0400
        Re: Email::Address::XS pali@cpan.org - 2016-06-01 18:44 +0200
          Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-06-30 20:51 -0400
            Re: Email::Address::XS pali@cpan.org - 2016-07-03 14:39 +0200
              Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-07-03 19:52 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-07-12 17:43 +0200
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-08-01 19:00 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-08-02 23:03 +0200
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-08-02 18:36 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-08-08 23:41 +0200
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-08-18 17:21 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-08-18 23:35 +0200
                Re: Email::Address::XS pali@cpan.org - 2016-08-20 12:01 +0200
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-08-22 22:34 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-08-23 09:56 +0200
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-08-24 22:55 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-08-25 09:40 +0200
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-09-03 18:24 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-09-05 10:25 +0200
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-09-11 18:58 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-09-12 09:26 +0200
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-09-16 18:37 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-09-18 01:05 +0200
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-09-18 11:26 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-09-18 17:40 +0200
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-09-28 09:29 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-09-30 12:38 +0200
                Re: Email::Address::XS pali@cpan.org - 2016-11-13 03:17 +0100
                Re: Email::Address::XS pali@cpan.org - 2016-11-13 03:24 +0100
                Re: Email::Address::XS pali@cpan.org - 2017-01-14 21:32 +0100
                Re: Email::Address::XS pali@cpan.org - 2017-01-23 14:44 +0100
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2017-01-28 15:48 -0500
                Re: Email::Address::XS pali@cpan.org - 2017-02-14 21:26 +0100
                Re: Email::Address::XS pali@cpan.org - 2017-03-08 00:03 +0100
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-08-22 22:26 -0400
                Re: Email::Address::XS pali@cpan.org - 2016-08-23 09:50 +0200
                Re: Email::Address::XS perl.pep@rjbs.manxome.org (Ricardo Signes) - 2016-08-23 09:31 -0400
  Re: Email::Address::XS pali@cpan.org - 2017-02-18 21:25 +0100

csiph-web