PHP Classes

Gmail - Message Number out of range

Recommend this page to a friend!

      POP3 e-mail client  >  All threads  >  Gmail - Message Number out of range  >  (Un) Subscribe thread alerts  
Subject:Gmail - Message Number out of range
Summary:Message Number Out of Range error received randomly.
Messages:7
Author:yan
Date:2007-06-15 22:02:03
Update:2010-04-16 02:24:29
 

  1. Gmail - Message Number out of range   Reply   Report abuse  
Picture of yan yan - 2007-06-15 22:02:04
Hello,

I am attempting to use the mime_parser and conjunction with the pop3 class, so that I can save all attachments from all unread emails (More than 20 attachments at a time).

I'm currently fetching all the message IDs from Gmail using ListMessages. And for every message ID, I call this:

pop3://user:password@pop.gmail.com:995/$MessageId?tls=1&debug=1&html_debug=0

This works for the first few messages but it breaks after a certain number of messages by giving me the error:

Could not retrieve the message: Message number out of range.
Segmentation fault

I echo'ed out the messageID together with the error message, the ID is the same as the one obtained using ListMesssages.

I have the rerun the script a couple of times to get all the attachments. Any idea why?


  2. Re: Gmail - Message Number out of range   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-06-16 06:48:10 - In reply to message 1 from yan
That suggests that the messages are being deleted or moved to another mailbox.

When you want to process many messages at once, I suggest that you do it all in a single connection.

In that case it is not possible to use the pop3:// stream handler. You need to use the OpenMessage and GetMessage class functions instead.


  3. Re: Gmail - Message Number out of range   Reply   Report abuse  
Picture of yan yan - 2007-06-18 16:22:58 - In reply to message 2 from Manuel Lemos
Thanks for the help. I changed the code to use OpenMessage and then GetMessage, it works great now and decodes all attachments. It's faster too.

  4. Re: Gmail - Message Number out of range   Reply   Report abuse  
Picture of Will Robertson Will Robertson - 2008-10-27 22:16:37 - In reply to message 3 from yan
Sorry I'm resurrecting this thread but what did you change the code to? I am having the same problem.

  5. Re: Gmail - Message Number out of range   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-10-31 20:53:08 - In reply to message 4 from Will Robertson
Nowadays it is no longer necessary to use the OpenMessage and GetMessage functions directly. Just use the pop3:// stream handler class provided with the POP3 class to pass a stream file name for a given message to the MIME parser class as if it was an actual file.

  6. Re: Gmail - Message Number out of range   Reply   Report abuse  
Picture of Stujo Stujo - 2010-04-16 01:49:05 - In reply to message 5 from Manuel Lemos
I'm still getting the S -ERR Message number out of range. error when connecting to the gmail server

  7. Re: Gmail - Message Number out of range   Reply   Report abuse  
Picture of Stujo Stujo - 2010-04-16 02:24:29 - In reply to message 6 from Stujo
Wow I just got the streaming working!

It's amazing, the trick is to look at the browse_mailbox.php sample

It doesn't look like RSET works after you stream the message.

You just get it once