Agent only works for the designer , not others?

I had this one posted on R5 but got no response. I tested this one on R6 and it also behaved like R5 . Please help !***************************************

Hi,

I designed a “share” agent that run “After new mails arrive” . The purpose is to check the SendTo field for an old domain name . If found then, automatically reply to the sender to inform about the new domain . That agent is on a mail template . I do have my name of the group that have “Allow to run unrestriced agent” . I “Replace Design” of my mail database with that new template, and test the agent (sent e-mail with ABC.com as domain). It runs as designed, i.e. I received the auto-reply . But when I asked another user to “Replace Design” to have that agent runs on her mail database , that agent won’t work . I went into her mail, in design mode and “ran” it manually then it worked . By the way the “Allow run restricted agent” and “Personal Agent” is authorized to all users of the domain.

Here is the code :

Sub Initialize

Dim s As New NotesSession

Dim db As NotesDatabase

Dim doc1 As NotesDocument 'incoming mail

Dim reply As NotesDocument

Dim dc As NotesDocumentCollection

Dim view As NotesView

Dim entry As NotesViewEntry

Dim nav As NotesViewNavigator

Dim rtitem As NotesRichTextItem

Dim richStyle As NotesRichTextStyle

'Search for mail with old domain name in the field: INetSendTo

Dim INetSendTo As String, SearchforString As String

Dim positionOfChar As Long

Dim positionOfCharCase As Long

Dim found As Variant

Set db = s.CurrentDatabase

Set dc = db.UnprocessedDocuments

Set reply = New NotesDocument(db)

If dc.Count >0 Then

For i = 1 To dc.Count

Set doc1 = dc.GetNthDocument(i)

INetSendTo =doc1.SendTo(0)

SearchforString = “ABC” 'search for old domain name

positionOfChar& = Instr(INetSendTo$ , SearchforString$ )

'If found occurence of word “ABC” in the domain name

If positionOfChar& <> 0 Then

reply.Form = “Memo” 'Send notification about new domain name

reply.SendTo = doc1.From

reply.Subject = “ABC company domain changed to 123”

'Body of the auto notification

Set richStyle = s.CreateRichTextStyle

Dim richText As NotesRichTextItem

Set richText = New NotesRichTextItem( reply, “Body” ) 'Set body as richtext

richStyle.FontSize = 10

Call richText.AppendStyle(richStyle)

Call richText.AppendText(“Hi,”) 'Hi

reply.Send(True)

End If

Next

Call dc.UpdateAll

End If

End Sub


The problem is not the code since it works fine when I tested it by sending e-mail address with ABC.com as domain. I believe it’s an authority problem but have looked at agent (share), my authority on the server , etc… and could not find anything wrong.

Please help. My appreciation to all suggestions, pointers .

Many thanks in advance.

Subject: Journaling?

I haven’t tried this but how about journaling the messages that contain the old domain and then running an agent on the journaled messages?

Subject: RE: Journaling?

Hi Lawrence,

That’s a great idea. I never thought of it. Thank you very much.

Subject: Agent only works for the designer , not others ???

Since you didn’t mention it in your post, I would assume that the users for whom the agent (signed by you) doesn’t run have a different home server than you do, and their home servers’ INI files don’t have AMGR_DISABLEMAILLOOKUP=1.

You can read the details of this setting in the Troubleshooting Agents article in the Agent FAQ. (It’s also linked under “Problems with mail agents: common gotchas.”)

Subject: RE: Agent only works for the designer , not others ???

Hi Bruce,

I really, really appreciate your suggestion. That is exactly what you pointed out. That user has a different mail server.

Thank you, thank you , thank you. You really made my day !

Subject: RE: Agent only works for the designer , not others ???

Do you know of the tool called ‘test’ from Designer? It would have told you that was the problem right away.

Subject: RE: Agent only works for the designer , not others ???

Be care if you use AMGR_DISABLEMAILLOOKUP. Read the FAQ for side effects. Typically the side effects are too painful to use it.