Home > Domino Tips > Administrator > E-mail > Message recall
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

E-MAIL

Message recall


John Morehouse
01.18.2005
Rating: -3.43- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


View member feedback to this tip.

This agent provides the ability to recall a message from the Domino domain. It's nice when someone sends a message with confidential information to the entire company. You can quickly and easily remove the document from every mail file in the company. For large environments I would re-evaluate the removal just for server loads, possibly get the names from the memo and then just open those mail files for message removal. It's not perfect, but it works great in our environment.

  Code: Dim db As NotesDatabase, 
mailDb As NotesDatabase
 Dim s As New NotesSession
 Dim doc As NotesDocument
 Dim dc As NotesDocumentcollection
 Dim notesdbdir As New 
NotesDbDirectory("mailserver/ou")
 Dim mailDoc As NotesDocument
 Dim thisLog As NotesLog
 counter = 0
 
 '//evaluate the membership of the 
administrators group.  If user does 
not have access, then exit the routine
 eval$ ={@IsMember("Administrators";
@UserNamesList)}
 admin = Evaluate(eval$)
 
 '//check security level of the person 
running the agent - admin level 
only
 If admin(0) = 0 Then
  Msgbox "You do not have the required 
access to recall 
messages.  Please contact your Lotus Administrator. 
 Thank you", 0+16, "Error - 
Security Level"
  Exit Sub  
 End If
 
 '//script will error if the mailDoc is not set, 
so force the script to 
resume next on any error
 On Error Goto errHandler
 
 '//get a handle to the current database
 Set db = s.CurrentDatabase
 
 '//get the first database in the directory on the server.
 Set mailDb = notesdbdir.getfirstdatabase(DATABASE)
 
 '//get the documented marked for removal
 Set dc = db.UnprocessedDocuments
 
 '//check to make sure that a message(s) 
has been selected for recall.  
If not, then exit sub
 If dc.count = 0 Then 
  Msgbox "You have not selected any 
messages to recall.  Please 
select the messages you wish to recall and 
run this agent again. Thank you.", 
0+16, "Error - No Message Selected"
  Exit Sub  
 End If
 
 '//Due to server performance, 
get only one document at a time 
 Set doc = dc.getfirstdocument
 
 '//set the log file using some
 information from the document
 Set thisLog = New NotesLog("Message Recall")
 Call thisLog.OpenNotesLog("server/ou", "applog.nsf")
 thisLog.LogActions = True
 
 
 '//log brief information about the 
offending email for tracking purposes
 Call thisLog.logaction
(" ********** RECALL STARTED ************* ") 
 Call thisLog.logaction(db.title & " - " 
& doc.universalid)
 
 '//check the database for the particular 
unid in question
 While Not(mailDb Is Nothing)
  
  '//if the filepath of the database 
has 'mail' in it, then it 
should be a mail file
  If Instr(mailDb.filepath,"mail") Then
   
   '//in order to search by unid, you
 must open an 
instance of the mail file
   Call mailDb.Open("", "")
   
   '//Search for the document by unid
   Set mailDoc = 
mailDb.getdocumentbyunid(doc.universalid)
   
   '//if the document matching is found, 
remove the 
document
   If Not(mailDoc Is Nothing) Then
    Call mailDoc.Remove(True)
    Call thisLog.logaction("      -- document 
removed from db: " & mailDb.title)
    
    '//count the number of databases that we 
remove 
the document from, for verification purposes
    counter = counter + 1
   End If
  End If
  
  '//get the next database in the directory
  Set mailDb = notesdbdir.GetNextDatabase
 Wend
 
 '//display message to the administrator
 Msgbox "Recall Complete.  
Please review log file for validation. Thank 
you and have a great day, " 
& s.commonusername,  0+64, "Message Recall"
 
 '//finish up the logging and then close the log file
 Call thisLog.LogAction
(" Agent Completed -- " & counter & " databases 
were accessed.")
 Call thisLog.logaction
(" ********** RECALL COMPLETE ************* ") 
 Call thisLog.Close
 
errHandler:
 Resume Next
End Sub

MEMBER FEEDBACK TO THIS TIP

This code has major flaws and I have experienced it even before this was posted. The problem is when the message is delivered across the domain and different servers in the domain it doesn't maintain the same universal ID for the document. The universal document ID changes with no fixed rule.

—Ashok N.

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member John Morehouse. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
E-mail
Secure Lotus Notes/Domino 8.x from mail to unknown recipients
Domino server setting and email policy tricks admins must know
Top 10 Lotus Notes/Domino administration tips of 2008
Can Lotus Notes/Domino and Microsoft SharePoint play nice together?
Using Formula language code to sort Lotus Notes messages by subject
LotusScript action button manages Lotus Notes mail files
Exploring Lotus Notes Domino 8.0.1 and beyond
LotusScript agent moves tagged spam email to junk mail folder
Send SMS text messages between Lotus Notes 7 and mobile devices
Update to Exchange Server 2003 Connector for Lotus Notes

Lotus Notes Domino Agents
How the Agent Profiler tool improves Notes/Domino performance
Run or restart Notes/Domino agents via text messages
Calculating results for a column in a Lotus Notes view
Approve Lotus Notes documents using a BlackBerry mobile device
LotusScript agent indexes Lotus Notes/Domino databases
Top 10 Lotus Notes/Domino coding and development tips of 2008
Open documents in Lotus Notes from the Web without a UNID
Fix and update Lotus Notes documents with limited access
Verify scheduled agent status with Domino Extensible Language (DXL)
Top 10 Lotus Notes Domino programming and development tips of 2007

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts