6.0.0-git
2021-01-19

[#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 2005-06-22 (5690 days ago)
Due
Updated 2005-06-24 (5688 days ago)
Assigned 2005-06-23 (5689 days ago)
Resolved 2005-06-24 (5688 days ago)
Milestone
Patch No

History
2005-06-24 05:04:13 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
2005-06-24 04:44:17 Michael Slusarz Comment #3 Reply to this comment
Bug 2142 is a duplicate of this bug.
2005-06-23 20:56:58 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.


2005-06-23 09:00:11 Jan Schneider Assigned to Michael Slusarz
State ⇒ Assigned
 
2005-06-22 19:38:42 alh (at) indiana (dot) edu Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
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