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

Lotus Notes - Auto-reply agent suddenly not working

Hi all,

I have a problem with the Autoreply agent created in a mailbox.
The agent was created long ago and was working fine until recently it's stopped.
The agent should be running after a new mail arrived.
But now even I create a new agent, it just doesn't run at all.
When I tried to run it manually, then it sends the message out.

My user has "Manager" access and with all rights to this mailbox. And he has the rights to run the "restricted LotusScript/Java agents" on server too.

Anything I missed out? Can someone enlighten me?
Thanks very much in advance.

Here is my coding.
================================================================
Sub Initialize
      Dim sess As New NotesSession
      Dim db As NotesDatabase
      Dim dc As NotesDocumentCollection
      Dim doc As NotesDocument, maildoc As NotesDocument
      Dim itmAutoR As NotesItem
      Dim mailbody As NotesRichTextItem, bodyOrig As NotesRichTextItem
      Dim i As Integer
      
      On Error Goto ErrHandler
      Set db = sess.CurrentDatabase
      Set dc = db.UnprocessedDocuments
      
      For i = 1 To dc.Count
            Set doc = dc.GetNthDocument(i)
            If doc.HasItem("AutoReply") Then
                  'do nothing
            Else
                  If Trim(doc.From(0)) = "etravel@abc.com" _
                  Or Trim(doc.From(0)) = "CN=eTravel/OU=Users/O=ABC_Holdings" _
                  Or Ucase(Trim(doc.From(0))) Like "*WEBADMIN*" Then
                        'do nothing
                  Else
                        Set bodyOrig = doc.GetFirstItem("Body")
                        Set itmAutoR = New NotesItem(doc, "AutoReply", "Y")
                        Call doc.Save(True, False)
                        Set maildoc = New NotesDocument(db)
                        maildoc.Form = "Memo"
                        maildoc.SendTo = doc.From(0)
                        maildoc.CopyTo = "oacgi/Users/ABC_Holdings"
                        maildoc.SMTPOriginator = "eTravel@abc.com"
                        maildoc.From = "eTravel@abc.com"
                        maildoc.Principal = "eTravel"
                        maildoc.InternetAddress = "eTravel@abc.com"
                        maildoc.Subject = doc.Subject(0)
                        Set mailbody = New NotesRichTextItem(maildoc, "Body")
                        Call mailbody.AddNewLine(3)
                        Call mailbody.Appendtext("***THIS IS AN AUTOMATICALLY GENERATED ACKNOWLEDGEMENT***")
                        Call mailbody.AddNewLine(3)
                        Call mailbody.Appendtext("Thank you for your email.")
                        Call mailbody.AddNewLine(2)
                        Call mailbody.Appendtext("Your query is important to us.  We strive to respond to your queries within 2 working days.")
                        Call mailbody.AddNewLine(2)
                        Call mailbody.Appendtext("Your receipt of this automated response confirms that your email has been received.  It is therefore not necessary to send it to us again.")
                        Call mailbody.AddNewLine(2)
                        Call mailbody.Appendtext("Our working hours are Monday - Friday, 9:00am to 5:00pm.  We will be happy to assist you.")
                        Call mailbody.AddNewLine(3)
                        Call mailbody.Appendtext("Regards")
                        Call mailbody.AddNewLine(2)
                        Call mailbody.Appendtext("Etravel Admin")
                        Call mailbody.AddNewLine(1)
                        Call mailbody.Appendtext("---------------------------------------------------------------------------")
                        Call mailbody.AddNewLine(2)
                        Call mailbody.AppendRTItem(bodyOrig)
                        maildoc.PostedDate = Now
                        Call maildoc.send(True)
                        Call maildoc.Save(True, False)
                        Set maildoc = Nothing
                  End If
            End If
      Next
      
      Exit Sub
      
ErrHandler:
      Print "AutoReply-eTravel : Error at line " + Cstr(Erl) + " - " + Error$
      Exit Sub
End Sub
0
kspuea
Asked:
kspuea
  • 5
  • 4
  • 3
  • +5
5 Solutions
 
Sjef BosmanGroupware ConsultantCommented:
Hello kspuea,

First thing to look at: the log.nsf database on the server, in the Miscellaneous section. If the agent doesn't run, or it somehow stops, there will be a message in the log. Also, did you check the agent's log (in the agent list, right-click the agent, Log).

It could be a compilation problem, if you went from R5 to R6 and you never recompiled the agent. Just try to modify a line, especially those with Use "scriptlibrary", recompile and wait for a mail.

But check the logs first!

Regards,
   Sjef
0
 
Bill-HansonCommented:
Who signed the agent?  Was it an employee that has left the organization and no longer has authority to run agents on the server?
0
 
SysExpertCommented:
In addition, try to replace the design on the mail template, since if it is corrupted there may be issues.

Has anything changed ?

Client or server versions ?

 
I hope this helps !


0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
TTCTECHCommented:
How often is your Domino server restarted?  I've noticed agents not running if the server has not been restarted recently.

Other things to try:
Stop and restart Amgr.  Monitor your agent to verify it is working
Load another instance of Amgr (Agent Manager might be over-whelmed with agent processing).
0
 
kspueaAuthor Commented:
sjef_bosman,
    I have checked the log.nsf, nothing about the agent.
   And when I check the log of the agent, it said that the agent never run before. :(
   I have re-saved the agent too, even re-create, but still the same. Not running at all.

Bill-Hanson,
   The signer is the owner of the mailbox. Even I use the Admin ID to sign the agent, it still doesn't run.

SysExpert,
    Yes, the client version has changed from R5 to R7 recently, but server is still R5.
    But the upgrade is done much earlier than this agent stops.
    Should not be a problem, right?

TTCTECH,
    Will ask my Notes Admin to try this way.

Thanks very much to all.
0
 
Sjef BosmanGroupware ConsultantCommented:
Nothing in the log?? That's really strange, but if the agent's log also says that the agent never ran, it must be true.

Okay. How do mails arrive? Is it a person's mail database, or a mail-in database? Is it the database the router puts the mail in (the router triggers the agent indirectly, through the agent manager). What do you see when you look at the agent manager's queue, on the server console. Try both TELL AMGR SCHEDULE and TELL AMGR STATUS, or use the Admin client (Server/Status, Server Tasks, right-click Agent Manager, Tell Task... , click the options you want and verify that everything works correctly.

Another option is to create a new agent, with a different name, also triggered on After mail has arrived. Compare it with some other database that has similar agents but doesn't have this problem.
0
 
kspueaAuthor Commented:
Hi sjef_bosman,

Yeap, nothing in the log. :(

The mails arrives in a person's mail database, not mail-in database.
Didn't really take a look at the Agent Manager's queue or try any commands on console.
Will tell my Notes Admin to do so.

I have tried to create a new agent with different name, same settings, but still cannot work.
The strange thing is, even I created the same agent but with different name in my own mail database, it also doesn't work at all.
However, when I tried in R7, then it works.

Really don't know how to explain to my user.

Many thanks.
0
 
Sjef BosmanGroupware ConsultantCommented:
If it isn't R7, what server are you using?
0
 
kspueaAuthor Commented:
sjef_bosman,

I'm using R5 server, but the client is R7 version.
0
 
qwaleteeCommented:
What are the agent's "run on and "run when/schedule" properties?

Use the console to query agent manager's agent list and agent queues
0
 
kspueaAuthor Commented:
Hi qwaletee,

The agent is running on "after new mails arrived".
But it doesn't run at all when a new mail arrives.

Apparently, my Notes Admin realised that the agent manager was held up by another mailbox and caused all other scheduled agents not running.
We have restarted the server, all scheduled seems working fine now (including the Out-Of-Office agents). But just this particular agent still not running at all.
0
 
Sjef BosmanGroupware ConsultantCommented:
Still no messages in the log??
0
 
TTCTECHCommented:
What happens if your manually run the Agent (e.g. Run or Test)?
0
 
qwaleteeCommented:
I repeat: Use the console to query agent manager's agent list and agent queues

Also, is this in a real user's mail file? By default, Notes runs new mail agents only when it delivers mail into a database owned by the object holding the mail address.
0
 
kspueaAuthor Commented:
sjef_bosman: Yes, no message at all.

TTCTECH: I have tried to trigger it manually (Run / Test), it works.

qwaletee: Yes, it's real user's mail file. And even I moved the agent to my own mailbox, it still the same thing.
0
 
qwaleteeCommented:
Agent manager info,  please.  Third request.
0
 
dom_adminCommented:
From a Designer client, open the mail-file and take a look at the agents in the mailfile... Rightclick your "new mail triggered" agent, and select "design properties".

From the info-box which pops up, switch to tab no. 2, with the triangle - and check the contents of the field "$MachineName" - this name should be the Notes name of the users home-server... If it isn't then your agent will not be triggered...

If the servername is not correct, verify the clients server settings in the location document...
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 5
  • 4
  • 3
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now