So, unless there is another reason for this function be pull the message headers, why not get rid of that completely.

Simplify the cache naming process using that code:

$message_id = md5($IMAP->get_mailbox_name().'/'.$headers->uid);

I replaced that on my server and have not *seen* any problems or errors.


On 12/8/05, Thomas Bruederli < roundcube@gmail.com> wrote:
I would rather suggest to create a hash using folder name and message
UID: $message_id = md5($IMAP->get_mailbox_name().'/'.$headers->uid);

This should be unique enough since the temp file will be deleted when
the session ends.

Regards,
Thomas

P.S. Have not tested this line....


Geuis Teses wrote:
> Thomas, tell me if this is an adequate fix for this problem.
>
> In program/steps/mail/func.inc:
> ---------------------------------------------------------------
>   $message_id = $headers->messageID;
>
>   if(!$message_id){
>       $message_id=$_SESSION['client_id']."@noheader.com
> < http://noheader.com>";
>   }
>
>   $temp_dir = $CONFIG['temp_dir'].(!eregi('\/$', $CONFIG['temp_dir']) ?
> '/' : '');
>   $cache_dir = $temp_dir.$_SESSION['client_id'];
>   $cache_path = $cache_dir.'/'.$message_id;
> ---------------------------------------------------------------
>
> I added:
>   if(!$message_id){
>       $message_id=$_SESSION['client_id']."@noheader.com
> <http://noheader.com>";
>   }
>
> So, if there is no messageID specificed in the email, for caching
> purposes we set the value to the current session ID, with the appeneded
> @noheader.com <http://noheader.com>, which isn't really necessary but is
> there for style.
>
> On 12/8/05, *Thomas Bruederli* < roundcube@gmail.com
> <mailto:roundcube@gmail.com>> wrote:
>
>     Seems to be a problem reported earlier, when no message-ID is specified
>     in the message headers. RC does not check this yet and the path for
>     caching becomes incomplete.
>
>     Regards,
>     Thomas
>
> [...]