We've been getting problems when forwarding certain messages. Results in an error 406. I think I've tracked this to a problem with how RC is handling certain message headers, as I posted in another email.
I'm also concerned about these errors in the logs, and I think they're related. It seems like RC is not able to create the temp folders it needs in the temp directory. I've set permissions on the temp folder and func.inc to 777 for testing purposes, but it still can't create the directory.
Anyone have some ideas about this?
This is the code from func.inc at line 1202, where its making the directory. // create dir for caching if (!is_dir($cache_dir)) $dir = mkdir($cache_dir); else $dir = true;
These are the errors: [07-Dec-2005 09:51:02] PHP Warning: fopen(temp/1962c11578bbf49800aa6f6593f9f3af/): failed to open stream: Is a directory in /home/public_html/webmail/program/steps/mail/func.inc on line 1207 [07-Dec-2005 09:51:02 -0500] PHP Error: Failed to write to temp dir in /home/public_html/webmail/program/steps/mail/func.inc on line 1214 [07-Dec-2005 09:51:05] PHP Warning: fopen(temp/1962c11578bbf49800aa6f6593f9f3af/): failed to open stream: Is a directory in /home/public_html/webmail/program/steps/mail/func.inc on line 1207 [07-Dec-2005 09:51:05 -0500] PHP Error: Failed to write to temp dir in /home/public_html/webmail/program/steps/mail/func.inc on line 1214
On Wed, 7 Dec 2005 12:24:12 -0500, Geuis Teses geuis.teses@gmail.com wrote:
These are the errors: [07-Dec-2005 09:51:02] PHP Warning: fopen(temp/1962c11578bbf49800aa6f6593f9f3af/): failed to open stream: Is a directory in /home/public_html/webmail/program/steps/mail/func.inc on line 1207 [07-Dec-2005 09:51:02 -0500] PHP Error: Failed to write to temp dir in /home/public_html/webmail/program/steps/mail/func.inc on line 1214 [07-Dec-2005 09:51:05] PHP Warning: fopen(temp/1962c11578bbf49800aa6f6593f9f3af/): failed to open stream: Is a directory in /home/public_html/webmail/program/steps/mail/func.inc on line 1207 [07-Dec-2005 09:51:05 -0500] PHP Error: Failed to write to temp dir in /home/public_html/webmail/program/steps/mail/func.inc on line 1214
I asked if you had created the dirctories, but guess I didn't talk about user and group perms. what user is your webserver running as? what group is your webserver running as? for freebsd the answer is www and www. once you know these, you can set the user/group perms on temp and logs correctly. so with those (that may or may not be yours) and your PATH, it would look like:
chmod -R www:www /home/public_html/webmail/temp chmod -R www:www /home/public_html/webmail/logs
hth
http://fak3r.com - you don't have to kick it
I don't want to be a spoiler, but this does not look like a permision problem to me...
fopen(temp/1962c11578bbf49800aa6f6593f9f3af/) ^^ Check! It is trying to open a directory. And that's what the error is saying as well. But fopen cannot open directories, that explains the error. It looks like the filename is missing, or the last char should not be a "/".
phil schreef:
On Wed, 7 Dec 2005 12:24:12 -0500, Geuis Teses geuis.teses@gmail.com wrote:
These are the errors: [07-Dec-2005 09:51:02] PHP Warning: fopen(temp/1962c11578bbf49800aa6f6593f9f3af/): failed to open stream: Is a directory in /home/public_html/webmail/program/steps/mail/func.inc on line 1207 [07-Dec-2005 09:51:02 -0500] PHP Error: Failed to write to temp dir in /home/public_html/webmail/program/steps/mail/func.inc on line 1214 [07-Dec-2005 09:51:05] PHP Warning: fopen(temp/1962c11578bbf49800aa6f6593f9f3af/): failed to open stream: Is a directory in /home/public_html/webmail/program/steps/mail/func.inc on line 1207 [07-Dec-2005 09:51:05 -0500] PHP Error: Failed to write to temp dir in /home/public_html/webmail/program/steps/mail/func.inc on line 1214
I asked if you had created the dirctories, but guess I didn't talk about user and group perms. what user is your webserver running as? what group is your webserver running as? for freebsd the answer is www and www. once you know these, you can set the user/group perms on temp and logs correctly. so with those (that may or may not be yours) and your PATH, it would look like:
chmod -R www:www /home/public_html/webmail/temp chmod -R www:www /home/public_html/webmail/logs
hth
P
http://fak3r.com - you don't have to kick it
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
Pieter wrote:
I don't want to be a spoiler, but this does not look like a permision problem to me...
fopen(temp/1962c11578bbf49800aa6f6593f9f3af/) ^^ Check! It is trying to open a directory. And that's what the error is saying as well. But fopen cannot open directories, that explains the error. It looks like the filename is missing, or the last char should not be a "/".
phil schreef:
On Wed, 7 Dec 2005 12:24:12 -0500, Geuis Teses geuis.teses@gmail.com wrote:
These are the errors: [...]
I asked if you had created the dirctories, but guess I didn't talk about user and group perms. what user is your webserver running as? what group is your webserver running as? for freebsd the answer is www and www. once you know these, you can set the user/group perms on temp and logs correctly. so with those (that may or may not be yours) and your PATH, it would look like:
chmod -R www:www /home/public_html/webmail/temp chmod -R www:www /home/public_html/webmail/logs
hth
P
Thomas, tell me if this is an adequate fix for this problem.
$message_id = $headers->messageID;
if(!$message_id){ $message_id=$_SESSION['client_id']."@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"; }
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, which isn't really necessary but is there for style.
On 12/8/05, Thomas Bruederli 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
Pieter wrote:
I don't want to be a spoiler, but this does not look like a permision problem to me...
fopen(temp/1962c11578bbf49800aa6f6593f9f3af/) ^^ Check! It is trying to open a directory. And that's what the error is saying as well. But fopen cannot open directories, that explains the error. It looks like the filename is missing, or the last char should not be a "/".
phil schreef:
On Wed, 7 Dec 2005 12:24:12 -0500, Geuis Teses geuis.teses@gmail.com wrote:
These are the errors: [...]
I asked if you had created the dirctories, but guess I didn't talk about user and group perms. what user is your webserver running as? what group is your webserver running as? for freebsd the answer is www and www. once you know these, you can set the user/group perms on temp and logs correctly. so with those (that may or may not be yours) and your PATH, it would look like:
chmod -R www:www /home/public_html/webmail/temp chmod -R www:www /home/public_html/webmail/logs
hth
P
The current sessionID is not unique enough; and doesn't identify the message neither. The usage of 'noheader.com' is rather ugly. I would propose to skip the caching if there is no messageID. There is no reliable way to generate a unique messageID for yourself; without querying the IMAP server to see if the message-ID doesn't exist yet
On Thu, 8 Dec 2005 09:04:11 -0500, Geuis Teses geuis.teses@gmail.com 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"; }
$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"; }
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, which isn't really necessary but is there for style.
On 12/8/05, Thomas Bruederli 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
Pieter wrote:
I don't want to be a spoiler, but this does not look like a permision problem to me...
fopen(temp/1962c11578bbf49800aa6f6593f9f3af/) ^^ Check! It is trying to open a directory. And that's what the error
is
saying as well. But fopen cannot open directories, that explains the error. It looks like the filename is missing, or the last char should not be a "/".
phil schreef:
On Wed, 7 Dec 2005 12:24:12 -0500, Geuis Teses
wrote:
These are the errors: [...]
I asked if you had created the dirctories, but guess I didn't talk about user and group perms. what user is your webserver running as? what group is your webserver running as? for freebsd the answer is www and www. once you know these, you can set the user/group perms
on
temp and logs correctly. so with those (that may or may not be
yours)
and your PATH, it would look like:
chmod -R www:www /home/public_html/webmail/temp chmod -R www:www /home/public_html/webmail/logs
hth
P
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
[...]
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
[...]