Author Topic: All recent SVN versions and DBmail  (Read 5072 times)

Offline vivitron

  • Newbie
  • *
  • Posts: 3
All recent SVN versions and DBmail
« on: July 26, 2006, 12:31:30 AM »
Greetings,

I've had issues with almost every svn version of roundcube with dbmail for a while. Basically, everything works except when you click to view a message, it returns to the same screen which displays the listing of messages once again. After some research, I found where the problem is stemming from but do not know where to proceed from here.

In program/include/rcube_imap.inc around line 913, this function appears:
Code: [Select]
function get_raw_body($uid)
  {
  if (!($msg_id = $this->_uid2id($uid)))
   return FALSE;

    $body = iil_C_FetchPartHeader($this->conn, $this->mailbox, $msg_id, NULL);
    $body .= iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, NULL, 1);

  return $body;
  }

which is called from program/steps/mail/func.inc where a cached copy cannot be found (around line 1299) in function rcmail_message_source which is called when you view a message:
Code: [Select]
// get message from server
 $msg_source = $IMAP->get_raw_body($uid);

Now, the part that fails is in the get_raw_body routine when it states:
Code: [Select]
if (!($msg_id = $this->_uid2id($uid)))
   return FALSE;

It returns false. I've tried disabling this check (knowing it was probably important) which ends in an endless loop in the request. My question is, what does this check do? I can guess all day but have not had the time to figure it out. For some reason, with dbmail, it returns false here and causes the system to display the folder instead of the message.

If anyone has any ideas, I'd be grateful. I do have caching disabled and am running the dbmail server locally. I have not tested against other servers.

Sincerely,
Dustin

Offline vivitron

  • Newbie
  • *
  • Posts: 3
Re: All recent SVN versions and DBmail
« Reply #1 on: August 04, 2006, 11:14:22 AM »
No ideas?

Offline EricS

  • Jr. Member
  • **
  • Posts: 45
Re: All recent SVN versions and DBmail
« Reply #2 on: August 04, 2006, 12:26:57 PM »
Dustin,

Here's everything I know on the topic:
  • A message that exists in a mailbox on an IMAP server has a couple different identifers - one is called the "Message Sequence Number" and one is the "Unique Identifier" (see RFC3501 section 2.3.1). The MSN is just a 1-n number where n is the number of messages in the mailbox. The UID is a unique number that normally does not change over the lifetime of the mailbox.
  • Within the rcube/iloha IMAP code, the "Message Sequence Number" is kept in the "id" field of the message header, and the "Unique Identifier" is kept in the "uid" field.
  • Most IMAP commands that deal with individual messages expect the message(s) to be identified with the "Message Sequence Number" or "id" number.
  • RCube prefers to keep the UID within in-memory lists, etc., since it's a more stable identifier.
  • Therefore, before performing operations on the IMAP server, RCube needs to be able to look up the MSN/ID for a message, given the UID.

So, I'm not sure why that lookup is failing on your IMAP server, since all it's doing is just a "SEARCH UID xxx" command.

Take a look at program/lib/imap.inc:iil_C_UID2ID, which calls iil_C_Search. Try running that SEARCH manually on your IMAP server (by telnetting to the imap port) and see if it gives you back an MSN/ID value.

That's about all I can suggest - good luck!
-Eric