?
Solved

Found a Lotus script but don't know what it does

Posted on 2006-04-10
19
Medium Priority
?
784 Views
Last Modified: 2013-12-18
In a mailtemplate I found a Lotus script but I don't know what is that for.
(makes the bcc field empty when the mail creator isn't equal with the notes sesion username?)

Sub Initialize
      Dim ss As New notessession
      Dim db As notesdatabase
      Dim doc As notesdocument
      Dim useris$
      Set doc=ss.DocumentContext
      If doc.creator(0)<>ss.username Then
            doc.newbcc=""
            Call doc.save(False,False)
      End If      
End Sub
0
Comment
Question by:attila01
  • 10
  • 6
  • 3
19 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16416451
Strange code...

To begin with, it is in an Initialize. Where does this come from? A Script library? An agent? A form?

Referring to DocumentContext is always related to agents, and mostly to Web-agents. From Notes, its value may be Nothing.

So I assume this is a web-agent. Where is it called from, WebQueryOpen or WebQuerySave? In either case, the doc.Save is BAD coding.

Please some more info before I'm completely on the wrong track...
0
 

Author Comment

by:attila01
ID: 16416601
You're right, this is an Initialize and it comes from an agent.

This Agent is in a mailtemplate. Every user (in our company) has this agent among others in his mailbox.
The name of the agent is "delbcc" which could indicates that this has something to do with an action like delete the bcc field?

We don't have web access to Lotus Notes.

0
 

Author Comment

by:attila01
ID: 16416728
Trigger of the agent = Before mail arrives
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16416893
AFAIK, that agent isn't in the standard template. Who created the agent? NewBCC must also be some addition to the template. Maybe the idea was to prevent mails to be sent or forwarded by secretaries... I don't know.

Lots of guesswork here. Interesting puzzle, something for Marilyn... ;)
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16419442
I saw this type of agent in 4.6, when people wanted to delete the group mail names so people wouldn't know the bulk group names in order to send to everyone.   Notes teams added this to remove the contents of the BCC field for a couple of reasons.. to prevent SPAM - server tries forever trying to route the rest of the BCC list.  This would clear the list before mail arrives.. or in mail.box..

But, the documentcontext is a new method with r6, isn't it?  The odd thing is that there seems to be a new field added called newbcc, wonder what that is used for?  And before they delete it the contents, wonder what it has in it?

My guess is that there is another agent that uses the field newbcc.   and it would be interesting to see where it is called, and if it even works.

Try NotesPeek on the mail template to see who wrote it and when it was added.   You can also identify other parts of the mail template that might be affected.

In the meantime, I would suggest grabbing nice new vanilla mail templates from a temporary local server install (if you don't have them sitting on your server), and compare the two to see what you do and don't need.   Or maybe you don't need any of the "add ons"
0
 

Author Comment

by:attila01
ID: 16423851
You mean if somebody enter a group name in the bcc field this agent would break up the group names? The group member's name would be displayed but not the group name?
0
 

Author Comment

by:attila01
ID: 16423979
I checked the agent list's last modified column and saw that all agent was modified by me or the Lotus Notes Template Development, except 2 agents.

The above I've already pasted and the one below.
This two was modified by another mailserver (administrated by the lotus administrator in the central of the company)

This second agent's name is: (SendBCC) see the contents in my next comment:
I replaced the company name with xxx


0
 

Author Comment

by:attila01
ID: 16424014
Sub Initialize
      Dim session As New NotesSession
      Dim ws As New notesuiworkspace
      Dim db As Notesdatabase
      Dim bccdoc As NotesDocument
      Dim rtitem As NotesRichTextItem      
      Dim uidoc As notesuidocument
      Dim createDate
      Dim ddate As NotesDateTime
      Set db = session.CurrentDatabase
      Set uidoc=ws.currentdocument
      Set bccdoc=uidoc.document
      bccdoc.Form = "Memo"
      bccdoc.~Storage="."
      Set ddate = New NotesDateTime( Cstr(bccdoc.created) )
      createDate = Right$(Cstr(ddate.dateonly),2)
      If bccdoc.EnterBlindCopyTO(0)="" Then
            Select Case createDate
            Case "01":      bccdoc.EnterBlindCopyTO="CN=xxx1/OU=xxx/OU=xxx/O=Company"
            Case "02":      bccdoc.EnterBlindCopyTO="CN=xxx2/OU=xxx/OU=xxx/O=Company"
            Case "03":      bccdoc.EnterBlindCopyTO="CN=xxx3/OU=xxx/OU=xxx/O=Company"
                ........
                ........
            Case "31":      bccdoc.EnterBlindCopyTO="CN=M31/OU=KHH/OU=PHYCOMP/O=YAGEO"            
            End Select
      Else
            Select Case createDate
            Case "01":      bccdoc.EnterBlindCopyTO=Arrayappend(bccdoc.EnterBlindCopyTO,"CN=xxx1/OU=xxx/OU=xxx/O=Company")
            Case "02":      bccdoc.EnterBlindCopyTO=Arrayappend(bccdoc.EnterBlindCopyTO,"CN=xxx2/OU=xxx/OU=xxx/O=Company")                             Case "03":bccdoc.EnterBlindCopyTO=Arrayappend(bccdoc.EnterBlindCopyTO,"CN=xxx3/OU=xxx/OU=xxx/O=Company")
                                ............
                                ............

            Case "31":      bccdoc.EnterBlindCopyTO=Arrayappend(bccdoc.EnterBlindCopyTO,"CN=xxx31/OU=xxx/OU=xxx/O=Company")            
            End Select      
      End If
      
      'bccdoc.ActionInProgress="1024"
      bccdoc.sendto=bccdoc.entersendto
      bccdoc.blindcopyto=bccdoc.enterblindcopyto
      bccdoc.copyto=bccdoc.entercopyto
      If bccdoc.sendto(0)="" Then
            Dim msg
            msg = ws.Prompt(PROMPT_OK, "Lotus Notes", "No names found to send mail to ", "", "")
      End If
      Call bccdoc.Send( False )
      Call bccdoc.save(False,False)
      'Call uidoc.close
End Sub
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16424347
In 4.6?? I seem to remember that in 4.6 the trigger "Before mail arrives" didn't exist. But that was ages ago...

It seems like some "primitive" form of Message Tracking device, with 31 mail-in databases or so. When or how is the agent triggered? Is it a replacement for the Send-button?
0
 

Author Comment

by:attila01
ID: 16425155
We're using R6.5 with two different mailtemplate but both of the mailtemplates has the above agents.

The first agent's properties:
Trigger: on event, before new mail arrives
Target: each incoming mail document

The second agent' properties:
Trigger: on event, agent list selection
Target: none




0
 

Author Comment

by:attila01
ID: 16425170
As far as I know a copy from every mail will be sent to a mailbox for archiving purposes.
That means, when a user click the send button a copy is sent automatically to a mailbox mentioned in the second agent:

bccdoc.EnterBlindCopyTO="CN=xxx1/OU=xxx/OU=xxx/O=Company"

Sometimes ( I guess, when something went wrong with the agent ) we saw in the bcc field an address we didn't entered.

So the mailtransfer is doubled within the company.
0
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 105 total points
ID: 16425922
I assume these agents are home-made, and that the second agent is activated from the Send-button in the Memo-form. If you want to make sure, then download DDSearch from the Sandbox (http://www-10.lotus.com/ldd/sandbox.nsf/0/f090b24ea76b1c0100256c45003e6396?OpenDocument) and search the template (NOT the mail database!!) for all occurrences of the name of the 2nd agent.

It is FAR better to set up Message Tracking, see the Admin Help database on that subject. You can specify what is to be stored in the Message Tracking database from the server's Configuration document in the NAB: Router/SMTP tab, Message Tracking.
0
 
LVL 18

Accepted Solution

by:
marilyng earned 105 total points
ID: 16432454
You know, I've seen something like this also, for archiving... the new SEC requirements say something like you have to save all transactions and such, so before message tracking, this was one way of sending the requisite copy to another application.  PRovided that the BCC's in the second agent were some type of group emails on another server.

Now, if you set up message tracking, then anything sent to the "archive" databases, might be encrypted, so who ever did this, did it this way to make sure that the deposited items could be read?

That's my guess.   I'm also going to guess that the select cases all correspond to users who have month days in their names, and each of those databases have other agents that roll the days into months, and those into years.. or possibly they're just archiving the month.

Clever actually, but they should have documented in the code, else someone without knowledge might go and delete the "month" users.
0
 

Author Comment

by:attila01
ID: 16433681
I downloaded and installed the DDSearch program sjef mentioned but got the error message  --Creation of Outline instance failed--
and the Search option under Tools in the Designer didn't appear.
This is the whole error message:

Error Report generated at 2006.04.12. 8:21:26

Program name:      DDSearch
Release:      2.1.0
Install path:      C:\Program Files\DDSearch
MultiInstance:      False
Process ID:      4194304
Thread ID:      2360
DLL error:      0
Module name:      cApplication::Install
Error number:      7436
Error message:
Creation of Outline instance failed

Module hints:

NotesSession: GetSession->OK
NotesSession: GetBuild->194
0
 

Author Comment

by:attila01
ID: 16433819
>>so who ever did this, did it this way to make sure that the deposited items could be read?
You're totally right.

>>the select cases all correspond to users who have month days in their names
You're right again. the mailbox names are:
- M01/CompanyNames
- M02/CompanyNames
......
- M31/CompanyNames

>>so before message tracking, this was one way of sending the requisite copy
You mean in the Administrator there is a way to send a copy from all the mails into a mailboy for archiving purposes?

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16434071
Yes, Message Tracking!!

> It is FAR better to set up Message Tracking, see the Admin Help database
> on that subject. You can specify what is to be stored in the Message Tracking
> database from the server's Configuration document in the NAB: Router/SMTP
> tab, Message Tracking.

That's what I wrote yesterday. It's there, you just have to switch it on...

And about SDDSearch: I did have some problems installing it, but if you do it exactly as they say it's usually easy. So, please, try to install again.

If you already have TeamStudio, you don't have to install DDSearch, TeamStudio can do the same and much more! Read also the attached response documents in the Sandbox where you downloaded DDSearch, or add one yourself if re-installing isn't successful.
0
 

Author Comment

by:attila01
ID: 16434740
Yes, I use the Message Tracking option, but there you can only see to whom the user sent mails and with which subject but it don't store the mails physically.


0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16434989
Sorry, see Mail Journaling, also in the Configuration document: Router/SMTP, Advanced, Journaling.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16438418
My bad, too.. I mean message Journaling, which would not have been available in R5, but is now, I think.. could be wrong.
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question