[imp] Third time: Undefined offset wrror/warning.

Michael M Slusarz slusarz@bigworm.colorado.edu
Mon, 15 Oct 2001 12:17:12 -0600


> Quoting Max Kalika <max@lsit.ucsb.edu>:
> 
> > Quoting M Z Rahman <zrahman@partex.net>:
> > 
> > > -------------the error message-------------
> > > Warning: Undefined offset: 1 in /www2/horde/imp/message.php on line 248
> > > Warning: Cannot add header information - headers already sent by
> (output
> > > started at /www2/horde/imp/message.php:248) in
> > /www2/horde/imp/message.php
> > > on line 369
> > > ------error message end here--------------
> > 
> > Some of my users have reported this.  It has never happened to me so it
> was
> > 
> > difficult to track down.  Just out of curiousity, what imap server do you
> > run?
> > 

I mentioned this problem a long time ago, but it never seemed to get fixed.  I 
was told that this does not occur to everyone, so I just sort of gave up and 
lived with it.

It is definitely NOT an imap problem (in that I used to use UW and now use 
Courier and I get the same problem).

It appears to be a problem (I believe) with the way IMP handles moving 
messages.  On my system, the following situations happen:

Deleting a message
==================
Say I have 3 messages in my mailbox and I am reading message number 1.  The 
message count reads "1 of 3".  If I delete the message, the next message will 
come up with a message count of "1 of 2".  This appears to be the correct 
behavior (since I am still on the first message of a mailbox that has 2 
messages).

Moving a message
================
Now, let's say I have the same mailbox setup.  This time, I move the message to 
another mailbox instead of deleting it.  The next message comes up with a 
message count of "2 of 3".  This is definitely not correct.  Essentially what a 
move does (conceptually) is copy a message and then deletes it.  Therefore, 
after a move operation, there are only 2 messages in the mailbox and I would 
still be on the first message.

However, the current IMP logic says I am on message 2 of 3.  So now you can see 
the problem - if I move to the next message in IMP, it think I will be on 
message 3 of the mailbox.  However, there is no more message 3 in the mailbox 
so I get the error message.

Let me know if you need anymore info on my problem. (RedHat 7.1, Linux 2.4 by 
the way)  I would try to provide a patch but the mailbox handling code is 
pretty convuluted (IMHO) and I don't really have the time right now.

michael

______________________________________________
Michael Slusarz [slusarz@bigworm.colorado.edu]
The University of Colorado at Boulder