[dev] [imp] Searching an IMAP mail store with Imp
Michael M Slusarz
slusarz at mail.curecanti.org
Sat Nov 5 08:32:43 PST 2005
Quoting Michael Rubinsky <mike at theupstairsroom.com>:
> Quoting Michael Slusarz:
>
>> You are right in that the BADCHARSET string is not required. But this
>> wasn't the reason why the code wasn't working. turns out that
>> _runCommand() was returning false on error instead of the error code.
>> So searching for any error return would never return true. i think i
>> have fixed this in the code.
>
>
> I found two problems that were still causing my searches to fail. The
> first, in framework/IMAP/IMAP/Search.php I fixed in CVS already, the
> parameter ['no_imap_search'] should have been ['no_imap_charset'].
>
> The second item, actually wasn't' causing any problems for me, but I
> figured it could be as issue for someone else:
>
> Index: lib/IMAP/Client.php
> ===================================================================
> RCS file: /repository/imp/lib/IMAP/Client.php,v
> retrieving revision 1.25
> diff -u -r1.25 Client.php
> --- lib/IMAP/Client.php 5 Nov 2005 03:31:20 -0000 1.25
> +++ lib/IMAP/Client.php 5 Nov 2005 05:11:30 -0000
> @@ -714,7 +714,7 @@
> function searchCharset($charset)
> {
> $this->_runCommand('SELECT INBOX');
> - $read = $this->_runCommand('SEARCH CHARSET UTF-9 TEXT
> "charsettest" 1');
> + $read = $this->_runCommand('SEARCH CHARSET ' . $charset . ' TEXT
> "charsettest" 1');
> return !is_a($read, 'PEAR_Error');
> }
as should be plainly obvious, i changed this code while debugging to
ensure that searchCharset would return false. i have changed this back
to the correct code. thanks for the catch.
michael
_______________________________________
Michael Slusarz [slusarz at curecanti.org]
More information about the dev
mailing list