6.0.0-beta1
9/24/25

[#2168] Compose window does not properly handle escaped quotes in To address
Summary Compose window does not properly handle escaped quotes in To address
Queue IMP
Queue Version 4.0.3
Type Bug
State Resolved
Priority 2. Medium
Owners slusarz (at) horde (dot) org
Requester alh (at) indiana (dot) edu
Created 06/22/2005 (7399 days ago)
Due
Updated 06/24/2005 (7397 days ago)
Assigned 06/23/2005 (7398 days ago)
Resolved 06/24/2005 (7397 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/24/2005 05:04:13 AM Michael Slusarz Comment #4
State ⇒ Resolved
Reply to this comment
The MIME _rfc822Encode function has been fixed in Horde 3.0.5 and HEAD.

The Mail_RFC822 function has already been fixed in the PEAR package by 
Chuck.  See:

http://pear.php.net/bugs/bug.php?id=2931
06/24/2005 04:44:17 AM Michael Slusarz Comment #3 Reply to this comment
Bug 2142 is a duplicate of this bug.
06/23/2005 08:56:58 PM alh (at) indiana (dot) edu Comment #2 Reply to this comment

[Show Quoted Text - 9 lines]
I think there are two bugs causing this. One is in Mail::RFC822, in 
_validateQuotedString(). This regex:



return !(preg_match('/(.)[\x0D\\\\"]/', $qstring, $matches) && 
$matches[1] != '\\');



does not sucessfully distinguish between "Adrian "The Man" Hosey" 
(illegal) and "Adrian \"The Man\" Hosey" (legal). Rather than continue 
to torture the regex, I added this right before the regex:



         $qstring_ary = explode('\"', $qstring);

         $qstring = implode('', $qstring_ary);



pressing out any \" pairs, because we know they're okay.



The other bug is in Horde::MIME, in _rfc822Encode(). This line:



return '"' . str_replace('"', '\\"', str_replace('\\', '\\\\', $str)) . '"';



doesn't recognize that a \" pair inside a quoted-string doesn't need 
to be escaped again.


06/23/2005 09:00:11 AM Jan Schneider Assigned to Michael Slusarz
State ⇒ Assigned
 
06/22/2005 07:38:42 PM alh (at) indiana (dot) edu Comment #1
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Compose window does not properly handle escaped quotes in To address
Queue ⇒ IMP
Reply to this comment
An address of the form



"Adrian \"The Man\" Hosey" <alh@indiana.edu>



is legal by RFC2822 Section 3.2.5, but Imp has trouble with it. If you 
attempt to reply to a message like that, it passes the address 
validator, but it tries to send to "" (i.e. a blank) and the message 
will be bounced by the MTA.


Saved Queries