PHP Classes

browse_mailbox.php is not working in some servers

Recommend this page to a friend!

      POP3 e-mail client  >  All threads  >  browse_mailbox.php is not working in...  >  (Un) Subscribe thread alerts  
Subject:browse_mailbox.php is not working in...
Summary:MIME message decode gives empty result.
Messages:7
Author:Mushfiqur Rahman
Date:2013-07-25 12:19:53
Update:2013-07-26 10:58:44
 

  1. browse_mailbox.php is not working in...   Reply   Report abuse  
Picture of Mushfiqur Rahman Mushfiqur Rahman - 2013-07-25 12:19:53
Dear Lemos,

Firstly thanks for your great pop3 and mime_parser class. I've been using your those classes in an application and which has been working great. But recently I've shifted my application on a new server and I strangely see that mime_parser's Decode method gives empty results. After that-

I've placed the browse_mailbox.php script on that server and find that it's also giving empty output.

Here I should mention that the servers all the ports are ok. Here I am giving you the page source of the output of browse_mailbox.php.


<html>
<head>
<title>Parsing a message with Manuel Lemos' PHP POP3 and MIME Parser classes</title>
</head>
<body>
<center><h1>Parsing a message with Manuel Lemos' PHP POP3 and MIME Parser classes</h1></center>
<hr />
<br />
<b>Warning</b>: stream_wrapper_register() [<a href='function.stream-wrapper-register'>function.stream-wrapper-register</a>]: Protocol pop3:// is already defined. in <b>/home/primatex/public_html/helpdesk/app/webroot/test/poptest/browse_mailbox.php</b> on line <b>27</b><br />
Connecting to mail.codetrio.com ...<br />
S +OK Dovecot ready.<br />
<PRE>Connected to the POP3 server &quot;mail.codetrio.com&quot;.</PRE>
C USER [email protected]<br />
S +OK<br />
C PASS hello+WORLD<br />
S +OK Logged in.<br />
<PRE>User &quot;[email protected]&quot; logged in.</PRE>
C STAT<br />
S +OK 1 11292<br />
<PRE>There are 1 messages in the mail box with a total of 11292 bytes.</PRE>
<h2>MIME message decoding successful</h2>
<h2>Message structure</h2>
<pre>array(3) {
["Headers"]=>
array(0) {
}
["Parts"]=>
array(0) {
}
["Position"]=>
int(0)
}
</pre><h2>Message analysis</h2>
<pre>array(2) {
["Type"]=>
string(4) "text"
["Description"]=>
string(12) "Text message"
}
</pre>C QUIT<br />
S +OK Logging out.<br />
Closing connection.<br />
<PRE>Disconnected from the POP3 server &quot;mail.codetrio.com&quot;.</PRE>

</body>
</html>


That was the page source for browse_mailbox.php script.

It's worthy to mention that your parse_message.php script is working properly on that server.

I've tried enough but couldn't get any clue.

Would you please check this.

Thanks

  2. Re: browse_mailbox.php is not working in...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2013-07-25 12:29:48 - In reply to message 1 from Mushfiqur Rahman
It seems PHP comes with a stream wrapper also called pop3 so the POP3 stream wrapper needs to be named something else. Just replace the stream wrapper name pop3 on the script by mlpop3 . It should work.

  3. Re: browse_mailbox.php is not working in...   Reply   Report abuse  
Picture of Mushfiqur Rahman Mushfiqur Rahman - 2013-07-25 13:45:17 - In reply to message 2 from Manuel Lemos
Dear Lemos,

Thanks for your quick response. Actually I was out of here.
And then maybe I do not understand your answer. Are you telling me to do as follows:

stream_wrapper_register('mlpop3', 'pop3_stream');

Is that ok? If so then I've done so but it didn't work.

I've also tried with the following one:
stream_wrapper_register('pop3', 'mlpop3_stream');
(and also changed the class name as mlpop3_stream which is on pop3.php script)

I think I should mention you that parse_message.php script works properly on the same server.

Thanks,

  4. Re: browse_mailbox.php is not working in...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2013-07-26 00:50:11 - In reply to message 3 from Mushfiqur Rahman
No, you just need set the name of the stream scheme to mlpop3.

stream_wrapper_register('mlpop3', 'pop3_stream');

Then you should use mlpop3://... instead of pop3://...

  5. Re: browse_mailbox.php is not working in...   Reply   Report abuse  
Picture of Mushfiqur Rahman Mushfiqur Rahman - 2013-07-26 08:19:28 - In reply to message 4 from Manuel Lemos
Hi Lemos,

It's simply excellent!
Very grateful to you.

Would you please suggest me some resources so that I can acquire these sort of knowledge? Like all the basic protocols and how they work or anything necessary for a good developer.

Again-

Thanks

  6. Re: browse_mailbox.php is not working in...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2013-07-26 09:04:09 - In reply to message 5 from Mushfiqur Rahman
You can learn about the details of the protocols in the RFC documents:

ietf.org/rfc.html

  7. Re: browse_mailbox.php is not working in...   Reply   Report abuse  
Picture of Mushfiqur Rahman Mushfiqur Rahman - 2013-07-26 10:58:44 - In reply to message 6 from Manuel Lemos
Thanks for the link.

Thanks,