Have you ever wondered how to visualize and forward spam mail including header information? Well, here's how!
In Domino Designer, open your mail database and copy-paste your Memo form. Rename the copy (which will be pre-labeled 'Copy of Memo') to 'Memo with Header'.
Now, above the form's Body field insert an editable text field named 'AllHeaders' with the default value 'AllHeaders' (you can add a line breaks and text labels to separate the header from the body or apply a different color/paragraph property to the field). Change Tab Orders: 'AllHeaders' should take the place of ?Body,? 'Body' (and subsequent if any) should increase by one.
In the new form, apply only the LotusScript changes as indicated in the code section below and leave the rest untouched. Save the form, quit Designer and Notes and re-start Notes (just to be safe). Now open your inbox and open the spam mail. Choose View/Switch Form and select the 'Memo with Header' form. Apply changes if necessary (remember header and body being two separate fields) in that form. When done, press the Forward action and voila! Ready to fight back!
Remarks: 0) Changes were successfully tested with R5.0.7 1) Never, ever apply 'hot' changes to your database design! Backup first! I really mean it! 2) The basic code is located in the PostOpen event of the form. It's quite simple. After the UIDoc has been opened, it will read all indicated items from the corresponding back-end document and populate the 'AllHeaders' field of the front-end document with it. It will add header information in ascending index order given by the array 'strDisplayThese()'. However, redundant information will not be added. For example, if there is more than one 'Received' item, its contents will be added only if different from the previous ones. 3) I'm not sure if this is the complete header information you'll need. I'm not spammed very often (lucky me). Thus, the item names were taken from Rainer's request-see credits below. However, you can easily modify the PostOpen's code by changing item names to scan and their sequence. 4) I've used a simple standard 'On Error' runtime trapping routine; however, I encourage you to substitute your preferred one. I always wonder how Lotus TemplateDevelopment is able to pass their very own QM without but that's a different story.
Credits go out to: ... 'in despair' Notes fellow Rainer Schlerege for pointing out the problem in de.comm.software.groupware and patiently explaining his needs to me ... my beloved daughter Alisa for silently resting asleep while I was tinkering around with this tonight ... all those tip and Usenet contributors saving me hours and hours of wasted time - I'm just trying to reciprocate ... the searchDomino.com team for their great ongoing engagement
'(Globals):
Option Public
Option Explicit
Option Base 0 'added
Use "CoreEmailClasses"
'Memo_with_Header:
Sub Querysave(Source As Notesuidocument, Continue As Variant)
'Call cMemoObject.QuerySave(Continue)
End Sub
Sub Postmodechange(Source As Notesuidocument)
'Call cMemoObject.PostModeChange()
End Sub
Sub Postopen(Source As Notesuidocument)
'***************************************************
'Unveils Mail Header Info ready to Forward
'by Wolfgang Flamme, 19.07.2001
'***************************************************
On Error Goto ErrorHandler
Dim docItem As NotesItem
Dim strDisplayThese(11) As String
Dim varDocItems As Variant
Dim strLinefeed As String, strLineInsert As String
Dim i As Integer
strDisplayThese$(0)={Received}
strDisplayThese$(1)={From}
strDisplayThese$(2)={X_Resent_From}
strDisplayThese$(3)={X_envelope_to}
strDisplayThese$(4)={SendTo}
strDisplayThese$(5)={Subject}
strDisplayThese$(6)={MIME_Version}
strDisplayThese$(7)={$Mailer}
strDisplayThese$(8)={$MessageID}
strDisplayThese$(9)={PostedDate}
strDisplayThese$(10)={$MIMETrack}
strDisplayThese$(11)={SMTPOriginator}
Set docThis=Source.Document
varDocItems=docThis.Items
strLinefeed$=Chr$(13) & Chr$(10)
Source.EditMode=True
For i%=Lbound(strDisplayThese()) To Ubound(strDisplayThese())
Forall varDocItem In varDocItems
Set docItem=varDocItem
If docItem.Name=strDisplayThese(i%) Then
strLineInsert$=strLinefeed$ & docItem.Name & ": " & Chr$(9) & docItem.Text
If Not(Instr(Source.FieldGetText({AllHeaders}), strLineInsert$)) > 0 Then
Call Source.FieldAppendText({AllHeaders}, strLineInsert$)
End If
End If
End Forall
Next
'Call cMemoObject.PostOpen(Source)
TheEnd:
Exit Sub
ErrorHandler:
Messagebox({Runtime Error in Form: 'Memo with Header'.PostOpen-Event} & strLinefeed$ & {Error } & Err() & { at line } & Erl() & {: } & Error())
Resume TheEnd
End Sub
Sub Postsave(Source As Notesuidocument)
'Call cMemoObject.PostSave()
End Sub
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
'Call cMemoObject.QueryClose(Continue)
End Sub
Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
'Continue = cMemoObject.QueryModeChange(Source)
End Sub
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
'Set cMemoObject = New UIMemoDocument
'Call cMemoObject.Init(Source,Isnewdoc)
End Sub
This was first published in July 2001