WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Lotus Notes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Lotus Notes R5 Spam Processing script


Attached is a Spam Processing script I wrote for reporting potential Spam in Lotus Notes R5.

You must have a valid SpamCop.net account to use this program.

- Charlie

;Lotus Notes R5 Spam Processing script 
;*********************************************************************************************************
;*********************************************************************************************************
;***  TITLE: SPAMPROC ************************************************************************************
;***  DATE: February 25, 2003  ***************************************************************************
;***  CREATED BY: Charlie Travis  ************************************************************************
;***  PURPOSE: This batch file extracts Lotus Notes R5 e-mail headers from possible Spam documents  ******
;***  e-mails possible SPAM documents, then e-mails the header information to SpamCop for processing.  ***
;***  Useage:  *******************************************************************************************
;***  1: You must have a legitimate account with Spamcop.net  ********************************************
;***  2: Add (compiled) SPAMPROC icon to your task bar  **************************************************
;***  3: Within your Notes Inbox View, place a check next to a (single) supspected Spam document.  *******
;***  4. Click the Spamproc icon in your task bar.  ****************************************************** 
;*********************************************************************************************************
;*********************************************************************************************************

ONCANCEL="EXIT"

;DEbug the script
;Delete previous debug file
FileDelete("C:\wbdebug.txt")

;Enable creation of new debug file
DebugTrace(@on, "c:\wbdebug.txt")

; SPAMPROC creates a temporary text file of the extracted e-mail header as C:\SPAMPROC\Spam.  This file
; is recreated each time SPAMPROC is run.

;Check to see if a SPAMPROC directory exists. Create one if it does not.
If !Direxist ("C:\SPAMPROC") then Dirmake ("C:\SPAMPROC")
If FileExist ("C:\SPAMPROC\spam.*") then FileDelete ("C:\SPAMPROC\spam.*")

;Remind user to select potential SPAM documents
;Message ("Before clicking OK!!", "Within your Inbox View, place a checkmark next to the SPAM document(s)") 

;Grab the Inbox window's attention.
WinActivate ("~Inbox - Lotus Notes")
;WinActivate ("~Inbox - Lotus Notes")

; Select File...
SendKey ("!f")

; ...Export
SendKey ("e")

; Export the header information (as Structured Text) to a file called "Spam"
DirChange ("C:\SPAMPROC\")
SendKeysTo ("Export", "C:\SPAMPROC\spam")
SendKey ("!x")
If Winexist ("~Export Warning") then SendKeysTo ("~Export Warning", "r")
WinActivate ("Structured Text Export")
SendKeysTo ("~Structured Text Export", "S")
SendKey ("~")
Delay (2)

; Wake up the Inbox window again
;WinActivate ("~Inbox - Lotus Notes")
WinActivate ("~Inbox - Lotus Notes")

; Create a new Notes Memo
SendKey ("!c")
SendKey ("e")

; Address the e-mail to SpamCop.net account
SendKeysTo ("~ Lotus Notes", "input your SpamCop account here")
SendKey ("{TAB}")
SendKey ("{TAB}")
SendKey ("{TAB}")
SendKey ("{TAB}")

; Import Spam1 into the body of the Memo
DirChange ("C:\SPAMPROC\")
SendKey ("!f")
SendKey ("i")
Delay (1)
WinActivate ("~Import")
SendKeysTo ("~Import", "C:\SPAMPROC\spam")
SendKey ("!m")
SendKeysTo ("Lotus Notes", "y")

; Send the e-mail on its way
SendKey ("!a")
SendKey ("s")

;Delay (2)

; Check if user has enabled Spell checking
If Winexist ("~Spell Check") then SendKey ("!i")

; Delete the offending Spam document
SendKey ("{DEL}")
SendKey ("!v")
SendKey ("r")
SendKey ("y")

:CANCEL
%ONCANCEL%
EXIT

Article ID:   W16192
File Created: 2004:03:30:15:43:12
Last Updated: 2004:03:30:15:43:12