Run agent from anonymous

I have an agent that runs after the document has been saved. The agent sends and email to one account “smith@xyz.com”. The problem is when the document has been saved by “Anonymous” (the user is not logged into Lotus). I get an error message that Anonymous cannot send to/from Anonymous, but I’m not sending to Anonymous, I’m sending to smith@xyz.com. For the Agent’s Security, I have it:

  • “Run as Web user”
  • Allow Public Access Users to view and run this agent
  • All readers and above
    For the ACL, I gave “default” Editor access with “Create LotusScript/Java agents”.

So, how can I have an agent send an email without the user being logged in?

Subject: Who do you want the email’s author to be?

If you want the email to come from the person that saved the document, then the person that saved the document will need to be signed in (not ‘Anonymous’) in order to run the agent.

If, however, if the requirement is to allow any ‘Anonymous’ user to send the mail, change the Agent’s ‘Run on Behalf’ of property to the address from which you’d like the email to originate.

I have quite a few agents that run on schedule and send mails - what I did was to create a user named ‘Automated Message/’, add them to the ACL of the databases as well as the security section of the server docs, and finally to the ‘Run on behalf of’ field of my agents.

Then when the agent runs, it is sent from ‘Automated message’ - no confusion.

A similar, alternate idea might be that if you already have a ‘Notes Administrator’ ID, run the agents on behalf of that user.

Subject: didn’t work

I tried what you suggested, I changed the “Run on behalf” to myself, I have Manager access. And it still doesn’t work, I get “Error 500, command not handled exception”.

Subject: Don’t run as web user.

Uncheck ‘Run as Web User’. You probably don’t need to ‘run on behalf of’ yourself, however, you may find that want to use a dummy user, as the emails will now come from you.

You may have to select ‘2. Allow Restricted Operations’.

Do you have authority to run unrestricted agents on the server? (Server Document → Security tab → Programmability Restrictions) - Check both ‘Sign or run unrestricted methods’ as well as ‘Sign Agents to run on behalf of someone else’.