• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1268
  • Last Modified:

After Mail Arrives agent not working.

Sorry for the lengthy detail but want to make sure you know the whole environment.

We have four Lotus Notes Domino R5.0.13 servers, 3 of which handle mail files. One that is setup to handle the main mail routing (call this one Main) and then pass it on to the other two servers if their mail file resides there. (call them Remote and Field)

We created a shared agent to run on the server copy of one of our user’s mail files. The agent was created with the Admin ID. We then went into Notes Administrator and signed the agent with the Field server’s ID. The agent is set up to forward a copy of all mail to the user’s blackberry device via an external internet address. (Call this address blackberry@internet.com) Here is copy of the code for reference.

Sub Initialize
      Dim s As New NotesSession
      Dim db As NotesDatabase
      Dim col As NotesDocumentCollection
      Dim doc As NotesDocument
      Dim maildoc As NotesDocument
      Set db = s.currentdatabase
      Set col = db.unprocesseddocuments
      Set doc = col.getfirstdocument
      While Not (doc Is Nothing)
            Set maildoc = db.createdocument
            maildoc.From = doc.From
            maildoc.ReplyTo = doc.From
            maildoc.SendTo = "blackberry@internet.com"
            maildoc.CopyTo = "blackberry@internet.com"
            maildoc.Subject = doc.Subject
            maildoc.Body = doc.Body
            maildoc.Form = "Memo"
            maildoc.Principal = doc.From                  
            maildoc.Send (False)
            Call s.UpdateProcessedDoc( doc )
            Set doc = col.getnextdocument( doc )
End Sub

This agent works perfectly for someone we had created this for a few months ago that resides on the Main server. This user in question resides on the Field server. We cut the code directly out of the working agent and created a new agent from scratch in the user’s mail file and pasted this code into the Lotus Script section of the agent and updated the address only.

In the log.nsf for the Field server we see the following error:

AMgr: Agent 'Blackberry' will not run. It is intended to run on 'MAIN' not ‘Field’

In troubleshooting this issue I have read in several instances to check the $MachineName and verify the name is correct. IT IS NOT! Since the schedule button is greyed out when the choice ‘After New Mail Has Arrived’ is selected, how do I update this field? I have tried changing to ‘On Schedule…’ and then changing the server that way. It updates fine shows Fields as the server to run on. I then save the changes. I check the $MachineName and it properly is set to Field. I then go back into the agent and change the when to run back to ‘After New Mail Has Arrived’ and save those changes. When I check the value of $MachineName it has reverted back incorrectly to Main.

I have checked the server document and the mail server for Field properly reads the hierarchial name of Field. Can someone please give me some direction on how to resolve this? Where else might this information keep resetting itself from? How can I force the agent to run on Field?
  • 2
1 Solution
make it Before Mail Arrives and test.
BlackmoorianDirector of Professional ServicesAuthor Commented:
We have with the same results. The $MachineName resets to the wrong server whenever we change from scheduled back to either option contigient upon mail arrival.
BlackmoorianDirector of Professional ServicesAuthor Commented:
We have found a solution....Apparently the home server of the user ID used to create or update the agent, not the owner or administration server of the mail file, is used in this case. When we created a special ID using the Field server as its home server and recreated the agent using that ID the $MachineName always remained Field rather than changing to Main as it had been doing. The agent began working just fine after that.

If anyone has any further information to add or if they know of another solution, please respond to this post.
Closed, 250 points refunded.
Community Support Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now