|
|
|
|
|
|
|
|
|
|
EMAIL MANAGEMENT
Add convenience to your spam blocker
By Kai Wilzer
In my previous two articles I introduced the topic of fighting spam within your Domino environment. If you've followed along from the beginning, we've already discussed the definition of spam and how to block it. All the basics are implemented, so a large amount of spam should be filtered right now. In this last article, we'll look at how to add more convenience for our end users.
Convenient addition to the personal Whitelist In the last article, we implemented a personal spam whitelist. For additional information on this topic, be sure to check out Chris Harvey's agent to process tagged spam at http://chris.brotherhoodmutual.com/dev/adminotes.nsf/plinks/CRHY-5M3QUJ.
In our current implementation, the user has to add addresses or domains manually. Of course, it would be more convenient if we have a button in the spam mail to automatically add the sender or his domain to the personal Whitelist. The button should work on both a view selecting one or more documents and within a single document.
Open your Mail template and create a new agent. Select the option to run manually from the agent list on selected documents. Select LotusScript and add the following code.
Const SpamWhiteList ="SpamWhiteListTX"
Const DNSBLSite = "$DNSBLSite"
Sub Initialize
Dim Session As notessession
Dim DB As NotesDatabase
Dim coll As NotesDocumentCollection
Dim UIWs As NotesUIWorkspace
Dim UIDoc As NotesUIDocument
Dim doc As NotesDocument
Dim docProfile As NotesDocument
Dim intChoice As Integer
Dim strFrom As String
Dim strDomain As String
Dim item As NotesItem
Dim boolFound As Integer
Set Session = New NotesSession
Set DB = Session.CurrentDatabase
Set docProfile = db.GetProfileDocument("CalendarProfile")
If docProfile Is Nothing Then
Messagebox "There is currently no profile for your mailfile available. Please click 'Tools' 'Preferences' "+_
"to create a new profile.", 16, "Unable to find profile"
Exit Sub
End If
If docProfile.HasItem(SpamWhiteList) Then
Set item = docProfile.GetFirstItem(SpamWhitelist)
Else
Set item = New NotesItem(docProfile, SpamWhiteList, "")
End If
REM Agent may be called from view or UIDocument
Set coll = DB.UnprocessedDocuments
If coll.Count = 0 Then
Set UIWs = New NotesUIWorkspace
Set UIDoc = UIWs.CurrentDocument
If Not UIDoc Is Nothing Then
Set doc = UIDoc.Document
Set coll = Nothing
Call coll.AddDocument(doc)
End If
End If
If coll.Count = 0 Then
Messagebox "Please select the sender you want to add to your Spam Whitelist.", 64, "No documents selected"
Exit Sub
End If
Set doc = coll.GetFirstDocument
Do While Not doc Is Nothing
If Not doc.HasItem(DNSBLSite) Then
Messagebox "The selected document is not flagged as Spam Message. Therefor it's not necessary to "+_
"add the sender to your Spam Whitelist.", 64, "No need to update Whitelist"
Else
If doc.HasItem("SMTPOriginator") Then
strFrom = doc.SMTPOriginator(0)
Else
strFrom = ""
End If
If strFrom = "" Then
If doc.HasItem("From") Then
strFrom = doc.From(0)
End If
End If
If strFrom = "" Then
Messagebox "The sender of the mail could not be identified with fields 'SMTPOriginator' and 'From'." +_
"Therefor it's not possible to add the sender to your Whitelist.", 16, "Sender not identified"
Else
strdomain = Mid$(strFrom, Instr(strFrom, "@")+1)
If strDomain = strFrom Then
intChoice = 7
Else
intChoice = Messagebox ("Instead of adding the single email address '"+strFrom+"' you may also add the "+_
"whole domain '"+strDomain+"'. This is quite convenient if the domain belongs to a business partner and "+_
"you often receive mails from different users within this domain '"+strDomain+"'."+Chr(10)+Chr(10)+_
"Click 'Yes' to add the domain to your whitelist."+Chr(10)+_
"Click 'No' to add the single email address to your whitelist."+Chr(10)+_
"Click 'Cancel' for no update.", 291, "Update Spam Whitelist")
Select Case intChoice
Case 6
REM Add Domain
strFrom = strDomain
Case 7
REM Add Single Address
Case Else
REM Cancel
Exit Sub
End Select
End If
boolFound = False
Forall strAllowed In item.Values
Select Case True
Case Ucase(strAllowed) = Ucase(strFrom)
boolFound = True
Messagebox "Sender '"+strFrom+"' is already listed in your Whitelist. ", 64, "No need to update Whitelist"
Exit Forall
Case Ucase(strAllowed) = Ucase(strDomain)
boolFound = True
Messagebox "Your Whitelist already contains an entry for Domain '"+strDomain+"'. As the sender '"+_
strFrom+"' also belongs to this domain it is not necessary to add this single emailaddress.", 64, _
"No need to update Whitelist"
Exit Forall
End Select
End Forall
If Not boolFound Then
Call Item.AppendToTextList(strFrom)
If docProfile.Save(False, False) Then
Messagebox "Address '"+strFrom+"' has been added to your Whitelist.", 64, "Whitelist updated"
Else
Messagebox "An error appeared while saving your updated whitelist. Please try again to update your "+_
"whitelist in some minutes. If the problem still appears please contact your Support.", 16, _
"Whitelist could not be updated!"
End If
End If
End If
End If
Set doc = coll.GetNextDocument(doc)
Loop
Print "Agent finished"
End Sub
|
[ Next ]
|
|
|
|
|
|
-- Advertisement --
AUTOMATE LOTUS NOTES USER ID MANAGEMENT
ID Manager 4.5 from HELP Software provides a new level of automaton for managing Lotus Notes IDs. ID Manager lets Lotus Notes administrators get out of the business of creating and managing user IDs. Use our ROI calculator to see how quickly ID Manager will pay for itself.
Learn more about HELP Software products |
-- Advertisement --
SECURTRAC - MONITOR AND CONTROL YOUR DOMINO ENVIRONMENT
When it comes to your business, how do you ensure compliance with SOX, HIPAA or other industry driven regulations? Use SecurTrac to monitor and audit the life cycle of all objects in your Domino environment.
- Database Monitor
- Mail Monitor
- Domino Directory Monitor
- Notes.ini File Monitor
- Intrusion Detection Monitor
Click here for details and a free evaluation copy. |
|
|
|
|
|
|
|
|