Lotus Domino Security

Lotus Domino
Platform Issues
Dear Experts I like to know how to prevent/track unauthorized access to my mailbox in Lotus Domino 5.0.8. I know I can check who has accessed my database from Database Properties-> User Details. But I like to know how to find out who has accessed my database from what IP address. Regards Nazrul

Answer Wiki

Thanks. We'll let you know when a new response is added.

This was a method of doing such a thing in R4.5 but I couldn’t say if it would still work in R5:-
With this tip, we will have control to know if and when somebody opened our mail box from his/her workstation,
it gets the windows library to know whom is the computer that is openning the mailbox and who is doing that,
through the computer and the user that are logged in on the network.
It puts it in a separate database, so that the intruder doesn’t discover the log.

Code: First create a new DB on the same path of the mailbox, the new db’s name should
be “your mailbox file name_log.nsf” and deselect ” show in ‘open database’ dialog in the db’s design properties.
Create a form named “(fmLog)” and insert four computed fields on it:
1 – name: dtCreated type: date/time(only date) default value: dtCreated
Field 2, 3,4 should be type text and allow multi-values and separator is new line
2 – name: sTime default value: sTime
3 – name: sMachine default value: sMachine
4 – name: sUser default value: sUser
Create a view for this form with the name you want, the first column categorized by field dtCreated.

On your mailbox create this script library named “DocumentProcessing”:

Paste it on Declarations of script library “DocumentProcessing”:

Declare Function GetComputerName Lib “kernel32” Alias
“GetComputerNameA” (Byval lpBuffer As String, nSize As Long) As Long
Declare Function GetUserName Lib “advapi32”
Alias “GetUserNameA” (Byval lpBuffer As String, nSize As Long) As Long

Paste it on Initialize of script library “DocumentProcessing”:

‘This is the startup when you or anybody opens yourself or somebody’s mailbox
Sub Initialize
On Error Goto Error_Trap
Dim ns As New NotesSession
Dim db As NotesDatabase
Dim dbLog As NotesDatabase
Dim server As String, path As String
Dim lpBuffer As String
Dim lpBufferUser As String
Dim doc As NotesDocument
lpBuffer = String(255, Chr$(0))
lpBufferUser = String(255, Chr$(0))
Call GetComputerName(lpBuffer, 255)
Call GetUserName(lpBufferUser, 255)
Set db = ns.CurrentDatabase
server = db.Server
path = dbPath(db)
Set dbLog = ns.GetDatabase( server, path )
Set doc = TodayDocument(dbLog)
Call RetrieveAccess(lpBuffer, lpBufferUser, doc)
Call doc.Save(True, False)
Exit Sub
Exit Sub
End Sub

Add this Function to script library “DocumentProcessing”:
‘This function verifies whether we already have a today document or not. If we have then it gets the document and return it,
‘if not it creates a new one and return it

Function TodayDocument(dbLog As NotesDatabase) As NotesDocument
Dim dToday As NotesDocument
Dim coll As NotesDocumentCollection
Dim search As String
Set dToday = dbLog.CreateDocument
search = |Form =”(fmLog)” & @Date(@Created) = @Date(|+Str$(Year(dToday.Created)) +|;|+Str$(Month(dToday.Created))+
Set coll = dbLog.Search(search, Nothing, 0)
If Not ( coll Is Nothing ) And ( coll.Count > 0 ) Then
Set TodayDocument = coll.GetFirstDocument
dToday.dtCreated = Today()
Set TodayDocument = dToday
End If
End Function

Add this Sub to script library “DocumentProcessing”:

‘This sub verifies though the windows library whom is the computer that is accessing your mailbox and who is doing it
‘Then it puts into the form the data that were retrieved by the script: computer, user and time

Sub RetrieveAccess(machine As String, user As String, doc As NotesDocument)
Dim itMachine As NotesItem
Dim itUser As NotesItem
Dim itDate As NotesItem
Set itMachine= doc.GetFirstItem(“sMachine”)
Set itUser = doc.GetFirstItem(“sUser”)
Set itDate = doc.GetFirstItem(“sTime”)
If ( itMachine Is Nothing ) Then
Set itMachine = doc.ReplaceItemValue(“sMachine”, machine)
Call itMachine.AppendtoTextList(machine)
End If
If ( itUser Is Nothing ) Then
Set itUser = doc.ReplaceItemValue(“sUser”, user)
Call itUser.AppendtoTextList(user)
End If
If ( itDate Is Nothing ) Then
Set itDate = doc.ReplaceItemValue(“sTime”, Cstr(Time))
Call itDate.AppendtoTextList(Cstr(Time))
End If
End Sub

Add this function to script library “DocumentProcessing”:

‘This function returns the current mailbox’s file path and adds a suffix “_log.nsf”, then it should be a file path of the mailbox log

Function dbPath(db As NotesDatabase) As String
Dim filepath As String
Dim i As Integer
filepath = db.FilePath
For i = Len( filepath ) To 1 Step -1
If (Mid( filepath, i, 1 ) = “.”) Then Exit For
dbPath = Left( filepath, i-1 ) & “_log.nsf”
End Function

Put this line in QueryOpen of Database Script of your Mailbox (or in the (Options) event):
Use “DocumentProcessing”

With that if the user opens your mailbox “running” the debug he/she won’t see the code neither the log documents.


Discuss This Question:  

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: