Hi

Try setting the interval for checking new mail to 5mins. This would allow for your program to go through larger emails and do all of the stuff it has to do. One minute might just be too short.
I had a similar problem when I changed my intervals to 10min I had no more problems.

Keith


"Gerhard Munro" <[EMAIL PROTECTED]>
Sent by: [email protected]

2006/02/01 02:44 PM

Please respond to
[email protected]

To
<[email protected]>
cc
Subject
[CTJUG Forum] Re: JavaMail bug





Enrico,
 
I have quite a few applications that does the same thing. To assist I need to see more. I also use a for loop and must admit that I seldom get messages bigger than 5 MB.
 
To delete the message I use msgs[i].setFlag(Flags.Flag.DELETED, true); where msgs is  Message[] msgs.
 
Regards,
 
Gerhard Munro
 



From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Enrico Goosen
Sent:
01 February 2006 01:11 PM
To:
[email protected]
Subject:
[CTJUG Forum] JavaMail bug

 
Hi All,
 
Wonder if anyone could help me with this problem.
I have a mail reader thread that checks for emails every minute.
 
// Retrieve the messages
Message[] messages = folder.getMessages();
// Loop over all of the messages
for (int messageNumber = 0; messageNumber < messages.length; messageNumber++) {

//Process message…save attachments to directory

message.setFlag(Flags.Flag.DELETED, true);
}
// Close connection, "expunging" the deleted messages
folder.close(true);
store.close();
 
Quite often we receive a very large email (+/- 10 MB), and by the time it gets to the next message in this for loop, the folder/store has already closed.
I’ve added code to check if the store.isConnected before attempting to read the next message, but this doesn’t fix the problem of the message not getting deleted.
 
Because the folder/store has closed prematurely the message doesn’t get deleted.
 
Is there someway of preventing the folder/store from closing prematurely?
Otherwise, how do I make sure that a message gets deleted?
 
Thanks,
 
Enrico Goosen
Software Developer
SAICOM TECHNOLOGY
TEL:       +2721 555 0726
FAX:     +2721 555 0821
CEL:     +2783 305 5676
EMAIL: [EMAIL PROTECTED]
 


--
This e-mail and its contents are subject to the
South African Medical Research Council
e-mail legal notice available at http://www.mrc.ac.za/about/EmailLegalNotice.html

Reply via email to