Run java agent on incoming mail

This should be achievable with a simple “before mail arrives agent” however I cant get a Java agents to execute using “before new mail arrives” :frowning:

I dont care where this agent runs as long as it’s before arriving in the users mailbox.

The forum tends to dismiss options invloving mail.box etc as risky so where’s the best & most efficient place to put my code?

Basically I need to lookup the orgin of incoming emails in a contacts database then store the Unique ID of the found contact in the incoming email.

Obviously efficiency is important in the scenario. I was planning on caching the info in my contacts database in a Java Hashmap (email address as key, doc as object) that the agent could then access with one small hit rather than searching through a large view. So as a secondary question? What are people thoughts on this - is it worth it? What would be the best way to publish a java object in the database?

Any suggestions on the best solution’s appreciated.

thanks,

Ross

Subject: run java agent on incoming mail

Did you read an article in Agent FAQ that goes over of how to write and debug agents which have ‘before deliery mail arrives’ agents?

There are a lot of discussion in the FAQ about the mail.box as well as before new mail arrives agents. If you have specific errors or problems, please post more details. In the agent FAQ check fa#0 “out of the inbox” article is a good start.