I am attempting to write an agent to filter e-mail to a folder. It is a very simple agent that I copied from the Agent FAQ (Out of the box).
The trigger for this agent is “Before mail arrives”. The problem that I am having is that the agent never runs. The agent log always says, “This agent has never been run before.” I got over 40 e-mails in my inbox this morning and the agent didn’t even run once.
What do I need to do to make the router run this agent? (Or find out why the router is not running it?)
I am listed in the “Run Restricted Agents” in the server’s configuration. The Mail Routing Events in the server’s log.nsf do not mention any errors (only that mail was delivered).
I have read all of the articles in the Agent FAQ and have not found any mention about what to look for when a mail agent just won’t run.
For those of you who are interested. Here is the agents “Test” results:
The following will occur when this agent is run:
‘CN=Phil W Knox/O=VOBG’ has unrestricted rights to run LotusScript/Java agents on ‘CN=VHNotesMail/O=VOBG’.
Allow restricted operations flag is selected. Restriction operations will be allowed.
Agent will be run by the Router as each new mail is delivered.
Home mail server for ‘CN=Phil W Knox/O=VOBG’ is ‘CN=VHNotesMail/O=VOBG’. Note: If needed, agent may failover to another server.
Started running agent ‘MoveSpam’ on 01/29/2004 09:43:14 AM
Running on new mail messages: 1 total
Testing: Ran LotusScript code
Done running agent ‘MoveSpam’ on 01/29/2004 09:43:14 AM
What is the server’s access in the ACL?Have you tried to put some print statements in the agent (just to make sure you can see it run).
Have you tried to run the agent on a schedule basis to make sure there is no errors within the code? IF it works via a schedule time, then it should with “before mail arrives”.
Lastly have you enter this console command:
tell amgr sched
It will show what agents are schedule on the server – this problematic agent should be in the list.
Subject: RE: Before mail arrives Agent not running
Thanks for the response.
The server (in fact all of our servers) have manager access in the ACL.
I put agent logging in the agent’s code (like described in the Agent FAQ). It never gets far enought to run it. Print also does nothing (since the log says if never ran).
I changed the trigger to “After mail arrives” as a test. It worked then (with some minor code modifications).
However, an “After mail arrives” agent is run by the Agent Manager. A “Before mail arrives” agent is run by the router (According to the Agent FAQ). The “tell amgr sched” does not list the agent. Should I expect it to? I don’t think I should because the Agent Manager does not run this type.
Subject: RE: Before mail arrives Agent not running
The agent is run by the router, so it will not e showing up in the agent manager schedule, so no, you should not expct it there.
Did you turn up Router debugging? This would show you the errors (if there are any) before the code is executing which would put logging info in the log. “Out of the inbox” article describes how to turn on Router debugging. Also run agent ‘test’ diagnostic to see if that gives you any helpful hints.