Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

apache force close #1

Closed
rigazy opened this issue Nov 22, 2017 · 8 comments
Closed

apache force close #1

rigazy opened this issue Nov 22, 2017 · 8 comments

Comments

@rigazy
Copy link

rigazy commented Nov 22, 2017

Dears @kirilkirkov ,
I have 2 issues and need your help for imap.class.php functions.

First,
Apache force close any time while the application refresh continuously when we're add attachments folder for attachment download, and run normally when it's folder deleted.
any advice for this issues ?

Second,
Email Inbox too slow when its load about 100 inbox messages, and failed to load more than 1000 messages.
any idea for this issues and make it faster?

Thanks,

@kirilkirkov
Copy link
Owner

@rigazy Hello!
For first question - I am not used this script from long time ago but now i test it again with Apache/2.4.18 (Ubuntu) and PHP 7.1.11-1+ubuntu16.04.1 and when i make directory /attachments with 777 rights i dont have any issues.

For second question - with this commit 1e866c2 i add limit of receiving messages because the script grab all and if they are many it is not good. But, yes email inbox load is slow procedure and i dont think that can be more faster.

@kirilkirkov
Copy link
Owner

Show me apache error logs after force close.

@rigazy
Copy link
Author

rigazy commented Nov 23, 2017

@kirilkirkov Hi, Many thanks :)
Thanks for your reply, thats very helpful for me and the app based on the second answer is going well and faster than before but it's true that's still running slowly. 👍

and here the screenshot for apache error logs.
apacheerror

@kirilkirkov
Copy link
Owner

kirilkirkov commented Nov 23, 2017

@rigazy Yes its slowly but this cant be skipped, does not depend on the code :/
It seem you use windows nt? try to change

private function saveToDirectory($path, $uid, $partIdentifier) { //save attachments to directory
$path = rtrim($path, '/') . '/';

to
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;

I cant reproduce the problem because i use Ubuntu.

@rigazy
Copy link
Author

rigazy commented Nov 24, 2017

@kirilkirkov thanks,
Sorry i got trouble again and i wish this is my last question >.<
For function getMessages($type = 'text'),
When i use this default type, it's return the messages with text type only and many of it return with encrypted text or text "Only Use Mail Client" and blank message , while i changed it to 'html' it's seem looks good, but the message with text type return blank message and sometime return with wrong messages. Need your help, how to fix it ? :)

@kirilkirkov
Copy link
Owner

kirilkirkov commented Nov 24, 2017

@rigazy I add full decoding support - 8cfab73

hmm.. try also to leave in processStructure function only this:
$messageBody = iconv($parameters['charset'], 'UTF-8//TRANSLIT', $messageBody);

instead

if (!empty($parameters['charset']) && $parameters['charset'] !== 'UTF-8') { if (function_exists('mb_convert_encoding')) { if (!in_array($parameters['charset'], mb_list_encodings())) { if ($structure->encoding === 0) { $parameters['charset'] = 'US-ASCII'; } else { $parameters['charset'] = 'UTF-8'; } } $messageBody = mb_convert_encoding($messageBody, 'UTF-8', $parameters['charset']); } else { $messageBody = iconv($parameters['charset'], 'UTF-8//TRANSLIT', $messageBody); } }

When i make tests i see that iconv returns me good text, but mb_convert_encoding broke it to "?????!"

@kirilkirkov
Copy link
Owner

@rigazy Is now working good?

@rigazy
Copy link
Author

rigazy commented Nov 27, 2017

@kirilkirkov ,
Sorry Sir T.T, There's another job to be done first.
i've not tried that code yet. I'll notice you if i found any trouble/issue again.
Many thanks for your attention.
You are such as a good mentor :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants