Hey Gang...I use EZ to parse incoming messages on my server... I was  
using this to pull my messages

$set = $pop3->fetchAll();

but found an issue when my server had a problem and my mail got backed  
up. When EZcomponents tried to fetch all messages, there were too many  
and I had memory exhaustion problems (I had been away on vacation and  
didnt get a chance to see the problem for a few days.. so the messages  
built up....YIKES!)

So I thought to use this to only get the first 50 (my script is called  
every 2 minutes, so that should be fine)

$set = $pop3->fetchFromOffset( 1, 50 );

But the problem is that if there are no messages on the server I get  
an offset error.

Fatal error: Uncaught exception 'ezcMailOffsetOutOfRangeException'  
with message 'The offset '1' is outside of the message subset '1',  
'50'.' in /usr/include/php/ezcomponents-2008.1/Mail/src/transports/ 
pop3/pop3_transport.php:800 Stack trace: #0 /var/www/vhosts/ 
mydomain.com/httpdocs/_maintenance/phpcgi/inboxManager.php5(76):  
ezcMailPop3Transport->fetchFromOffset(1, 50) #1 {main} thrown in/usr/ 
include/php/ezcomponents-2008.1/Mail/src/transports/pop3/ 
pop3_transport.php on line 800

I figure I can check to see if there are messages first, is that a  
good idea? which is the better way to do that?

$messages = $pop3->listMessages();
and check the length of the array

or using

$pop3->status( $num, $size );
and check the value of $num? would this be slower?

Is there a better method I should be using here? I would have to call  
$pop3->delete() to delete each message as I cycle through them. is  
there an attribute I can use such as "true" that I can add to  
fetchFromOffset() to delete messages as I cycle through it.

Thanks,

Fish
 ><>


-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to