Solved

Lotus Domino/Notes Mail Agent

Posted on 2007-04-03
4
349 Views
Last Modified: 2013-12-18
I need an agent that will run in a MailIn dB and delete any message that does not contain an .xls file. If that is not possilbe an agent that would delete any message that does not contain an attachment might suffice.
Running Domino and Notes 7.0.2

Thanks
0
Comment
Question by:HVBIT
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
Bill-Hanson earned 250 total points
Comment Utility
Sure, no problem.  Place this code in the Initialize event of a LotusScript agent that is set to run after new mail has arrived.

      Dim sess As New NotesSession()
      Dim db As NotesDatabase
      Dim dc As NotesDocumentCollection
      Dim doc As NotesDocument
      Dim docNext As NotesDocument
      Dim arrFileNames As Variant
      Dim strExtension As String
      Dim bDelete As Boolean
      
      Set db = sess.CurrentDatabase
      Set dc = db.UnprocessedDocuments
      If (dc.Count = 0) Then Exit Sub
      
      Set doc = dc.GetFirstDocument()
      Do While (Not doc Is Nothing)
            
            Set docNext = dc.GetNextDocument(doc)
            
            bDelete = True
            arrFileNames = Evaluate("@AttachmentNames", doc)
            If (Not Isempty(arrFileNames)) Then
                  Forall fileName In arrFileNames
                        If (Instr(fileName, ".") <> 0) Then
                              strExtension = Strrightback(fileName, ".")
                              If (Lcase(strExtension) = "xls") Then
                                    bDelete = False
                                    Exit Forall
                              End If
                        End If
                  End Forall
            End If
            If (bDelete) Then Call doc.Remove(True)
            
            Set doc = docNext
      Loop
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
Wouldn't the same be possible with a mail rule?
0
 

Author Comment

by:HVBIT
Comment Utility
Can't use Mail Rule, nothing to specify attachment.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
Is that so? Yes, most likely, I must say I didn't check. I'd expected an @AttachmentNames function to be absolutely valid in that context.

Thanks for posting back!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now