I am using James to hadnle the bounced emails. When ever there is a bounced mail  
from, it will be forwared to my James Server. I am running a thrad process to look at 
the bounced mails and forward the mails to some admin and delete the messages.

But I have problems in deleting the messages.Geting 
"javax.mail.MethodNotSupportedException: Expunge not supported
" . Here id the code:
//
public void process() {         
                try {
                        Message msgs[] = getMessages();
                        if( msgs != null){
                        log.info("Processing "+msgs.length+" Messages");
                        }
                        if (msgs != null)
                                for (int i = 0; i < msgs.length; i++) {
                                        if (!wasProcessed(msgs[i])) {
                                                msg[i].setFlag(Flags.Flag.DELETED, 
true);                                       }
                                }

                        
                        // Notify REPLYTO Address
                        // TODO to be implemented
                        // delete them from inbox  HAVING PROBELM HERE
                        folder.expunge();

                } catch (Exception e) {
                        // TODO: handle exception
                        log.warn("Exception thrown");
                }
        }
//


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to