Skip Menu |

This queue is for tickets about the MIME-tools CPAN distribution.

Report information
The Basics
Id: 101299
Status: resolved
Priority: 0/
Queue: MIME-tools

People
Owner: dfs+pause [...] roaringpenguin.com
Requestors: jubk [...] magenta.dk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: The "@" character is not encoded when using quoted-printable encoding
Date: Mon, 05 Jan 2015 11:33:00 +0100
To: bug-MIME-tools [...] rt.cpan.org
From: "Jørgen Ulrik B. Krag" <jubk [...] magenta.dk>
When using quoted-printable encoding from MIME::Words the "@" character is not encoded, leading to errors if the output is used in for example an email subject header. This might be intended behavior, but then it should probably be mentioned in the documentation. -- Jørgen Ulrik B. Krag Magenta ApS Incuba, Åbogade 15 DK-8200 Aarhus N tel +45 3336 9699 dir +45 5060 1268 http://www.magenta.dk/ jubk@magenta.dk
Subject: Re: [rt.cpan.org #101299] The "@" character is not encoded when using quoted-printable encoding
Date: Mon, 5 Jan 2015 07:47:32 -0500
To: bug-MIME-tools [...] rt.cpan.org
From: "David F. Skoll" <dfs [...] roaringpenguin.com>
Hi, Show quoted text
> When using quoted-printable encoding from MIME::Words the "@" > character is not encoded, leading to errors if the output is used in > for example an email subject header. This might be intended behavior, > but then it should probably be mentioned in the documentation.
I don't see how this is a bug. According to RFC2045, the @ character does not need to be encoded: (2) (Literal representation) Octets with decimal values of 33 through 60 inclusive, and 62 through 126, inclusive, MAY be represented as the US-ASCII characters which correspond to those octets (EXCLAMATION POINT through LESS THAN, and GREATER THAN through TILDE, respectively). What error could it cause if used in the subject? I just don't follow. Regards, David.
Subject: Re: [rt.cpan.org #101299] The "@" character is not encoded when using quoted-printable encoding
Date: Mon, 05 Jan 2015 14:37:24 +0100
To: bug-MIME-tools [...] rt.cpan.org
From: "Jørgen Ulrik B. Krag" <jubk [...] magenta.dk>
Hi David. I'm not an expert on the RFCs, but it might be related to the point (3) from RFC2047's section 5 (Use of encoded-words in message headers): http://tools.ietf.org/html/rfc2047.html#section-5 Show quoted text
> (3) As a replacement for a 'word' entity within a 'phrase', for example, > one that precedes an address in a From, To, or Cc header. The ABNF > definition for 'phrase' from RFC 822 thus becomes: > > phrase = 1*( encoded-word / word )
Show quoted text
> In this case the set of characters that may be used in a "Q"-encoded > 'encoded-word' is restricted to: <upper and lower case ASCII > letters, decimal digits, "!", "*", "+", "-", "/", "=", and "_" > (underscore, ASCII 95.)>. An 'encoded-word' that appears within a > 'phrase' MUST be separated from any adjacent 'word', 'text' or > 'special' by 'linear-white-space'.
/jubk On 05-01-2015 13:47, David F. Skoll via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=101299 > > > Hi, >
>> When using quoted-printable encoding from MIME::Words the "@" >> character is not encoded, leading to errors if the output is used in >> for example an email subject header. This might be intended behavior, >> but then it should probably be mentioned in the documentation.
> > I don't see how this is a bug. According to RFC2045, the @ character > does not need to be encoded: > > > (2) (Literal representation) Octets with decimal values of > 33 through 60 inclusive, and 62 through 126, inclusive, > MAY be represented as the US-ASCII characters which > correspond to those octets (EXCLAMATION POINT through > LESS THAN, and GREATER THAN through TILDE, > respectively). > > What error could it cause if used in the subject? I just don't follow. > > Regards, > > David. >
-- Jørgen Ulrik B. Krag Magenta ApS Incuba, Åbogade 15 DK-8200 Aarhus N tel +45 3336 9699 dir +45 5060 1268 http://www.magenta.dk/ jubk@magenta.dk
Subject: Re: [rt.cpan.org #101299] The "@" character is not encoded when using quoted-printable encoding
Date: Mon, 5 Jan 2015 09:10:56 -0500
To: bug-MIME-tools [...] rt.cpan.org
From: "David F. Skoll" <dfs [...] roaringpenguin.com>
On Mon, 5 Jan 2015 08:37:37 -0500 "Jørgen Ulrik B. Krag via RT" <bug-MIME-tools@rt.cpan.org> wrote: Show quoted text
> I'm not an expert on the RFCs, but it might be related to the point > (3) from RFC2047's section 5 (Use of encoded-words in message > headers):
Hmm, OK. That applies to the "phrase" part in From: and To: headers, but the Subject: header is pretty much free-form and an "@" should not cause trouble there. Also, MIME::tools calls down into MIME::QuotedPrint. I wonder if you should ask the maintainer of that module to add an optional parameter to encode that specifies additional encoding for the prohibited characters in RFC2047? Regards, David.
Subject: Re: [rt.cpan.org #101299] The "@" character is not encoded when using quoted-printable encoding
Date: Mon, 05 Jan 2015 16:01:31 +0100
To: bug-MIME-tools [...] rt.cpan.org
From: "Jørgen Ulrik B. Krag" <jubk [...] magenta.dk>
Comments below: On 05-01-2015 15:11, David F. Skoll via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=101299 > > > On Mon, 5 Jan 2015 08:37:37 -0500 > "Jørgen Ulrik B. Krag via RT" <bug-MIME-tools@rt.cpan.org> wrote: >
>> I'm not an expert on the RFCs, but it might be related to the point >> (3) from RFC2047's section 5 (Use of encoded-words in message >> headers):
> > Hmm, OK. That applies to the "phrase" part in From: and To: headers, > but the Subject: header is pretty much free-form and an "@" should not > cause trouble there. >
Yeah, the problem seems to be with mail clients that applies the "phrase" rules to the subject header. For now I have resolved my original problem by using base64 encoding instead of quoted-printable, which seems to work with all mail clients. Show quoted text
> Also, MIME::tools calls down into MIME::QuotedPrint. I wonder > if you should ask the maintainer of that module to add an optional > parameter to encode that specifies additional encoding for the prohibited > characters in RFC2047? >
I might look into this. Thank you for your feedback. /jubk -- Jørgen Ulrik B. Krag Magenta ApS Incuba, Åbogade 15 DK-8200 Aarhus N tel +45 3336 9699 dir +45 5060 1268 http://www.magenta.dk/ jubk@magenta.dk