Re: Odd error: "Undefined index: EXISTS"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 12, 2010 at 4:56 AM, Ralf Hildebrandt
<Ralf.Hildebrandt@xxxxxxxxxx> wrote:
> * Paul Lesniewski <paul@xxxxxxxxxxxxxxxx>:
>
>> > [Sat Jun 12 12:07:33 2010] [error] [client 10.39.172.126] PHP Notice: Undefined index: EXISTS in
>> > /var/www-lighty/squirrelmail-1.4.20/functions/mailbox_display.php on line 416, referer:
>> > https://webmail.charite.de/squirrelmail/src/download.php?startMessage=1&passed_id=17795&mailbox=INBOX&ent_id=3&passed_ent_id=0
>>
>> Actually, you sure about the version being 1.4.20?  Is that file
>> patched?  I am looking at 1.4.21SVN, and I think the line number
>> should be 424 (off the top of my head, I don't recall that file being
>> changed between the release of 1.4.20 and now).  Maybe you should
>> re-check that your code is up to date for starters.
>>
>> Anyway, if you want to debug this, you can spit out stuff in PHP by
>> putting this anywhere just above the problematic line:
>>
>> sm_print_r($mbxresponse);
>
> How can I change this to go to some log instead? It will confuse my
> users...

If you are debugging a live installation, here is some code that will
(hopefully) log the problematic SELECT commands when they happen.
You'll want to put this in the file functions/imap_mailbox.php at
about line 262, which should be immediately BEFORE the "return
$result;" line at the end of the function sqimap_mailbox_select()

if (!array_key_exists('EXISTS', $result) ||
!array_key_exists('UIDVALIDITY', $result)) { global $username;
$message = "Bad SELECT results: user = $username; mailbox = $mailbox;
raw IMAP response = " . implode(' [##] ', $read); $message =
str_replace(array("\r\n", "\r", "\n"), '', $message);
openlog('SQUIRRELMAIL', 0, LOG_MAIL); syslog(LOG_ERR, $message);
closelog(); }

If you have the Squirrel Logger plugin, you can use it to do this.
You can create a new "event" for it to log this, or just send these
messages to one of your events that you've already configured in its
config.php file (in this example, I use the "ERROR" event):

if (!array_key_exists('EXISTS', $result) ||
!array_key_exists('UIDVALIDITY', $result)) { include_once(SM_PATH .
'plugins/squirrel_logger/functions.php'); $event = 'ERROR'; $message =
"Bad SELECT results: mailbox = $mailbox; raw IMAP response = " .
implode(' [##] ', $read); $message = str_replace(array("\r\n", "\r",
"\n"), '', $message); sl_logit($event, $message); }

Do you have any idea how often these notices are happening?

-- 
Paul Lesniewski
SquirrelMail Team
Please support Open Source Software by donating to SquirrelMail!
http://squirrelmail.org/donate_paul_lesniewski.php

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users



[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux