I am using James to process incoming mail and save the
contents to a database. (Note, that I am not
forwarding the mail to users). 

In case of a database failure, I would like to queue
up the mail in a custom mail queue and process it
later when the database is available.

For starters, I have a custom mailet where I process
the mail,  (myCustomMailet.java). When I detect a db
unavailable situation, I do a 
jamesMail.setState("myprocessor");
which moves the mail to the myqueue directory.

I have created a processor called "myprocessor" in the
config.xml file to which, I forward mail, when the db
is
down. 
       <processor name="myprocessor">
           <mailet match="All" class="ToRepository">
           
<repositoryPath>file://${app.home}/../../../mail-queue/myqueue/</repositoryPath>
           </mailet>
       </processor>

Subsequently, when the db comes up, I shutdown James
and move the contents of the myqueue directory to the
spool directory. I restart James, hoping that the
mails would now be processed, but for some reason
James does not process them and returns them back to
the myqueue directory.

Ideally, I would like to write a matcher/mailet that
would fetch from myqueue (if there are any files) and
dump them into the spool queue.

Another question along those lines is, how do I fetch
mail from a particular queue ?

Thanks



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to