Hi,

        I applied to the source (1.2.1) a patch to the retrieve() function in 
AvalonMailRepository.java
so that james would delete a mail that could be retrieved. Apparently it 
forgets a lot of PersistentStore files around..

Does anybody have a solution for this? A perl script? Or a different 
implementation of the retrieve function

THe original was:
/*
     public MailImpl retrieve(String key) {
         MailImpl mc = (MailImpl) or.get(key);
         try {
             InputStream in = new AvalonMimeMessageInputStream(sr, key);
             mc.setMessage(in);
             in.close();
         } catch (Exception me) {
             throw new RuntimeException("Exception while retrieving mail: " 
+ me.getMessage());
         }
         return mc;
     }
*/

/*Modified version*/
public synchronized MailImpl retrieve(String key)
{

MailImpl mc = null;
     try {
     mc = (MailImpl) or.get(key);
     } catch (Exception me)
         {
             lock(key);
             sr.remove(key);
             or.remove(key);
             unlock(key);
             throw new RuntimeException("Exception while retrieving 
mail[destroyed the message :] " + me.getMessage());
             //!!!! Change Above exception to a Log Message !!!!
             //Ben

          }


   try {
         mc.setMessage(sr.retrieve(key));
         } catch (Exception me)
         {

             lock(key);
             //sr.remove(key);
             or.remove(key);
             unlock(key);
             throw new RuntimeException("Exception while retrieving 
mail[destroyed the message :] " + me.getMessage());

             //throw new RuntimeException("Exception while retrieving mail: 
" +  me.getMessage());
         }
   return mc;
}



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

Reply via email to