Summary | imap_append in Message.php fails with no errors |
Queue | IMP |
Queue Version | 4.1 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | slusarz (at) horde (dot) org |
Requester | david-shafer (at) uiowa (dot) edu |
Created | 03/24/2006 (7043 days ago) |
Due | |
Updated | 04/23/2010 (5552 days ago) |
Assigned | 03/25/2006 (7042 days ago) |
Resolved | 03/28/2006 (7039 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
the change, but it definitely wasn't working for us. Using tcpdump
showed PHP wasn't even attempting the append operation; it returned
false immediately, as though it didn't like the format of one of the
parameters. It made sense after I looked at other calls to
imap_append(). Why wouldn't both calls to imap_append() in Message.php
use the same calling syntax (with a fully qualified "{server}mailbox"
rather than just "mailbox")? The sample in the PHP documentation uses
a fully qualified mailbox as well:
http://www.php.net/manual/en/function.imap-append.php
The way it is now, I'm sure it works for many sites, but it definitely
doesn't work for all. I'm not surprised more people haven't noticed
it, because this code probably isn't used often. It's only used when
the trash folder is enabled, and the user's quota prevents them from
copying a deleted message to the trash, and apparently it's only a
problem for certain configurations.
Fyi, on the web server we're using php 4.3.9 (the Red Hat Enterprise
Linux 4 package php-4.3.9-3.9) with c-client 2002e
(libc-client-2002e-14). The IMAP server is Cyrus 2.2.12
(cyrus-imapd-2.2.12-3.RHEL4.1).
Assigned to Michael Slusarz
State ⇒ Feedback
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ imap_append in Message.php fails with no errors
Queue ⇒ IMP
was returning false with no errors. I was finally able to resolve the
problem by changing the imap_append() call to use IMP::serverString()
(much like the imap_append() call on line 539).
Here is the original version:
/* Save messages in Trash folder. */
foreach ($msg_text as $val) {
if (!@imap_append($imp['stream'], $trash, $val)) {
Here it is after the fix:
$folderstring = IMP::serverString($trash);
/* Save messages in Trash folder. */
foreach ($msg_text as $val) {
if (!@imap_append($imp['stream'], $folderstring, $val)) {