Firefox PHP

Module: External Phorummail

Posted by Thomas Seifert 
Re: Module: External Phorummail
October 06, 2010 06:54PM
On the read template {MESSAGES->author} contains "Anonymous User".

Use Email for Login: YES
Push Imported Mail over to the Mailing List Module: YES
Import Attachments: YES
Maximum Messagesize (characters): 65000
Enabled, POP3, SSL:NOT
Re: Module: External Phorummail
October 06, 2010 07:01PM
Try it without "Use Email for Login" for debugging.
The module itself does not intentionally clean out author information and its nowhere setting the anonymous user. For me its working fine and setting the correct author name.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: Module: External Phorummail
October 06, 2010 07:31PM
I received these error messages after a cronjob completion:

<b>Warning</b>:  mkdir() [<a href='function.mkdir'>function.mkdir</a>]: Permission denied in <b>.../mods/ext_phorummail/ezc/Mail/src/parser/parts/file_parser.php</b> on line <b>147</b><br />
<br />
<b>Warning</b>:  fopen(/tmp8020-1/jhj.jpg) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in <b>.../mods/ext_phorummail/ezc/Mail/src/parser/parts/file_parser.php</b> on line <b>154</b><br />
- Show quoted text -
<b>Fatal error</b>:  Uncaught exception 'ezcBaseFileNotFoundException' with message 'The file '/tmp8020-1/jhj.jpg' could not be found.' in .../mods/ext_phorummail/ezc/Mail/src/parts/fileparts/disk_file.php:86
Stack trace:
#0 ../mods/ext_phorummail/ezc/Mail/src/parts/file.php(86): ezcMailFile-&gt;__set('fileName', '/tmp8020-1/jhj....')
#1 ../mods/ext_phorummail/ezc/Mail/src/parts/fileparts/disk_file.php(32): ezcMailFilePart-&gt;__construct('/tmp8020-1/jhj....')
#2 ../mods/ext_phorummail/ezc/Mail/src/parser/parts/file_parser.php(269): ezcMailFile-&gt;__construct('/tmp8020-1/jhj....')
Re: Module: External Phorummail
October 07, 2010 01:19AM
I don't know this code, but it definitely looks like a slash is missing in there. /tmp8020-1/ should have been /tmp/8020-1/ probably.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: External Phorummail
October 07, 2010 01:50AM
The code is rather complex, I am trying to find out why I get the first warning:
Warning: mkdir() [<a href='function.mkdir'>function.mkdir</a>]: Permission denied
I am afraid that the permission denial will trigger all the other warnings.
Thanks for looking!
Re: Module: External Phorummail
October 07, 2010 08:19AM
Which External Phorummail version are you using?
If its the latest, try the following change:
file ext_phorummail.php line 75 and 107.
Change the line(s) from
$parser->setTmpDir($PHORUM["cache"]);
to
$parser->setTmpDir($PHORUM["cache"]."/");


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: Module: External Phorummail
October 07, 2010 04:02PM
Thanks, Thomas!
I corrected it but I still experience problems:
<b>Warning</b>:  mkdir() [<a href='function.mkdir'>function.mkdir</a>]: Permission denied in <b>.../mods/ext_phorummail/ezc/Mail/src/parser/parts/file_parser.php</b> on line <b>147</b><br />
<br />
<b>Warning</b>:  fopen(/tmp2864-1/jhj.jpg) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in <b>.../mods/ext_phorummail/ezc/Mail/src/parser/parts/file_parser.php</b> on line <b>154</b><br />
- Show quoted text -
<b>Fatal error</b>:  Uncaught exception 'ezcBaseFileNotFoundException' with message 'The file '/tmp2864-1/jhj.jpg' could not be found.' in .../mods/ext_phorummail/ezc/Mail/src/parts/fileparts/disk_file.php:86
Stack trace:
#0 .../mods/ext_phorummail/ezc/Mail/src/parts/file.php(86): ezcMailFile-&gt;__set('fileName', '/tmp2864-1/jhj....')
etc...

Language: PHP
That was the response from my ISP:   The error messages you posted to us indicated that your scripts attempted to create a folder called "tmp25373-1" on the Root folder of the server.   This is a problem as you do not have any access to the / (root) folder of the server. You do have access to the /tmp/ folder on the server, therefore you will need to configure your script to load files there, instead of trying to make a new folder.   To configure this, you might try configuring your mods/ext_phorummail/ezc/Mail/src/parser/parser.php file to load the proper path.   private static $tmpDir = null;   try setting it to:   private static $tmpDir = "/tmp";   Also, you may want to check the output of the following function in the mods/ext_phorummail/ezc/Mail/src/parser/parser.php file.   public static function getTmpDir() { if ( self::$tmpDir === null ) { self::$tmpDir = sys_get_temp_dir(); if ( substr( self::$tmpDir, strlen( self::$tmpDir ) - 1 ) !== DIRECTORY_SEPARATOR ) { self::$tmpDir = self::$tmpDir . DIRECTORY_SEPARATOR; } } return self::$tmpDir; }

What is your opinion?
Re: Module: External Phorummail
October 07, 2010 04:10PM
Quote
korsakov
Thanks, Thomas!
I corrected it but I still experience problems:
[...]
What is your opinion?

That you didn't do the change I suggested ;-).

What are the lines I named above now?
What is your cache directory set in the admin to?


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: Module: External Phorummail
October 07, 2010 04:51PM
Thanks, Thomas. I noticed a couple of patches on the server, so I decided to make a fresh install. In addition, I also included your proposed changes. It works beautifully! Thank you!
Re: Module: External Phorummail
October 10, 2010 02:59AM
After it worked for a while, I suddenly receive this warning again when Phorum is attempting to import email messages from my email account:
<b>Warning</b>:  mkdir() [<a href='function.mkdir'>function.mkdir</a>]: Permission denied in <b>.../mods/ext_phorummail/ezc/Mail/src/parser/parts/file_parser.php</b> on line <b>147</b><br />
I created a /tmp directory in this path and I also corrected line 91 in
Language: PHP
ext_phorummail/ezc/Mail/src/parser/parts/parser.php
from
Language: PHP
private static $tmpDir = null; to private static $tmpDir = "/tmp";



These are warnings from the Event module:
Language: PHP
PHP warning: fclose(): supplied argument is not a valid stream resource   PHP warning generated at .../mods/ext_phorummail/ezc/Mail/src/parser/parts/file_parser.php:253   Back trace:   Function fclose called at {path to Phorum}/mods/ext_phorummail/ezc/Mail/src/parser/parts/file_parser.php:253 ---- Function finish called at {path to Phorum}/mods/ext_phorummail/ezc/Mail/src/parser/parts/multipart_parser.php:146 ---- Function parseBody called at {path to Phorum}/mods/ext_phorummail/ezc/Mail/src/parser/parts/rfc822_parser.php:102 ---- Function parseBody called at {path to Phorum}/mods/ext_phorummail/ezc/Mail/src/parser/parser.php:236 ---- Function parseMail called at {path to Phorum}/mods/ext_phorummail/ext_phorummail.php:108 ---- Function phorum_ext_phorummail_scheduled called ---- Function call_user_func called at {path to Phorum}/common.php:1693 ---- Function phorum_hook called at {path to Phorum}/script.php:248 ----   Request info:     10/09/2010 05:50PM ext_phorummail Module PHP warning: fwrite(): supplied argument is not a valid stream resource details User info:   Anonymous user User IP address =   Additional details:   Message:   PHP warning: fwrite(): supplied argument is not a valid stream resource   PHP warning generated at .../mods/ext_phorummail/ezc/Mail/src/parser/parts/file_parser.php:240


What else could I do? Thank you.



Edited 1 time(s). Last edit at 10/10/2010 03:54AM by korsakov.
Sorry, only registered users may post in this forum.

Click here to login