Summary | Horde/IMP handling of literal strings |
Queue | IMP |
Queue Version | 3.2.4 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | Horde Developers (at) |
Requester | imp (at) mavetju (dot) org |
Created | 06/13/2004 (7711 days ago) |
Due | |
Updated | 07/24/2004 (7670 days ago) |
Assigned | 07/18/2004 (7676 days ago) |
Resolved | 07/24/2004 (7670 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Taken from Chuck Hagenbuch
Assigned to
Priority ⇒ 2. Medium
State ⇒ Assigned
Priority ⇒ 2. Medium
State ⇒ Assigned
State ⇒ Assigned
The submitted patch seems correct. Chuck, what do you think about it?
imp-3.2.4/lib/IMP.php.
* @return string The correctly quoted and escaped string.
*
* @since IMP 3.2.2
*/
function _rfc822Encode($str, $filter = '')
{
+ // strip double quotes if they are around the string already.
+ if (substr($str,0,1)=="\"" && substr($str,-1)=="\"")
+ $str=substr($str,1,-1);
$filter .=
"()<>@,;:\\\"[]\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\20\21\2
2\23\24\25\26\27\30\31\32\33\34\35\36\37\177";
if (strcspn($str, $filter) != strlen($str)) {
Please add this fix. People who use c-clients (like the imap-uw
library) which talk to imap servers which do return double quotes
around addresses if they were in the original email (like dbmail)
would be happy to be able to use Horde without problems.
Edwin
http://www.mavetju.org/
/* Don't show addressbook icon on print screen. */
$showIcon = !$printer_friendly;
if (isset($h->date)) $dat = htmlspecialchars(MIME::decode($h->date));
if (isset($h->to)) $to = buildAddressLinks($h->to, $showIcon);
if (isset($h->from)) $frm = buildAddressLinks($h->from, $showIcon);
$h is filled with information from imap_header().
$h->to is:
[0] => stdClass Object
(
[personal] => "with quotes"
[mailbox] => edwin
[host] => barnet.com.au
)
Are these double quotes around the value of the 'personal' key wrong?
Should this be without the double quotes? Does IMP expect it without
the double quotes around it?
After the assignment, $to contains the string '"\"with
quotes\"" <edwin@barnet.com.au>'. So buildAddressLinks
somehow escapes the double quotes in the $h->to field.
Please note that I'm not angry with any of you guys. I'm just trying
to make me see if the values returned by imap_header() are wrong.
Edwin
this; you asked us for help and have been arguing with our answers
ever since without actually trying them. This "bug" stays bogus.
overview, but it is displayed escaped in the message itself.
doesn't say anything.
For what it is worth, can I point you to the difference in what the
first and the second message returns: The first one (without the
quotes) returns it as a quoted string (and that goes fine in IMP), the
second one returns it as a literal string.
It is displayed fine in the message overview, but it is displayed
escaped in the message itself.
An other IMAP based mailreader (squirrelmail) doesn't display this
behaviour, which makes me believe it is an IMP issue and not an
c-client issue.
willing to try a different c-client. At this moment I'm using
cclient-2004, the one from UW. Before that I was using the 2002 version.
For what it is worth, can I point you to the difference in what the
first and the second message returns: The first one (without the
quotes) returns it as a quoted string (and that goes fine in IMP), the
second one returns it as a literal string. It all goes fine and it
looks good in the message overview, but the moment it is displayed in
the message itself it is shown.
Edwin
State ⇒ Not A Bug
c-client compiled with PHP.
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Queue ⇒ IMP
The messages feed to sendmail are:
From test@mavetju.org Sun Jun 13 04:45:13 2004
Return-Path: test@mavetju.org
To: no quotes <edwin@barnet.com.au>
Subject: BarNet test - no quotes
From: no quotes <test@mavetju.org>
Message-Id: <E1BZDRc-0005l5-75@mavetju.org>
Date: Sat, 12 Jun 2004 14:41:32 -0400
and
From test@mavetju.org Sun Jun 13 04:45:13 2004
Return-Path: test@mavetju.org
To: "with quotes" <edwin@barnet.com.au>
Subject: BarNet test - quotes
From: "with quotes" <test@mavetju.org>
Message-Id: <E1BZDRc-0005l5-75@mavetju.org>
Date: Sat, 12 Jun 2004 14:41:32 -0400
The messages are happily stored in on dbmail mail server. Using
horde/imp to access it, I see this in the message overview
18 04:41:32 no quotes BarNet test - no quotes 1kb
19 04:41:32 "with quotes" BarNet test - quotes 1kb
The messages themselves shows up as:
Date: Sat, 12 Jun 2004 14:41:32 -0400
From: no quotes <test@mavetju.org>
To: no quotes <edwin@barnet.com.au>
Subject: BarNet test - no quotes
And
Date: Sat, 12 Jun 2004 14:41:32 -0400
From: "\"with quotes\"" <test@mavetju.org>
To: "\"with quotes\"" <edwin@barnet.com.au>
Subject: BarNet test - quotes
And now the funny thing... this is how the second one shows up with POP3:
Date: Sat, 12 Jun 2004 14:41:32 -0400
From: with quotes <test@mavetju.org>
To: with quotes <edwin@barnet.com.au>
Subject: BarNet test - quotes
Fetching the messages manually (issuing the commands that IMP sends),
I get this for the first message:
a0005 FETCH 18:18 (UID ENVELOPE)
* 18 FETCH (UID 3388805 ENVELOPE ("Sat, 12 Jun 2004 14:41:32
-0400" "BarNet
test - no quotes" (("no quotes" NIL "test" "mavetju.org")) (("no quotes" NIL
"test" "mavetju.org")) (("no quotes" NIL "test" "mavetju.org")) (("no quotes"
NIL "edwin" "barnet.com.au")) NIL NIL NIL "<E1BZDRc-0005l5-75@mavetju.org>"))
a0005 OK FETCH completed
And this for the second message:
a0005 FETCH 19:19 (UID ENVELOPE)
* 19 FETCH (UID 3388806 ENVELOPE ("Sat, 12 Jun 2004 14:41:32
-0400" "BarNet test - quotes" (({13}
"with quotes" NIL "test" "mavetju.org")) (({13}
"with quotes" NIL "test" "mavetju.org")) (({13}
"with quotes" NIL "test" "mavetju.org")) (({13}
"with quotes" NIL "edwin" "barnet.com.au")) NIL NIL
NIL"<E1BZDRc-0005l5-75@mavetju.org>"))
a0005 OK FETCH completed
Other mail readers (mutt / mozilla) don't choke on this.
If you need more information on how to debug this problem, feel
free to contact me via email.