Manage Learn to apply best practices and optimize your operations.

Forward mail including mail headers

How to visualize and forward spam mail including header information

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!

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 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 team for their great ongoing engagement

Option Public
Option Explicit
Option Base 0 'added
Use "CoreEmailClasses"

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
	Set docThis=Source.Document
	strLinefeed$=Chr$(13) & Chr$(10)
	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
	'Call cMemoObject.PostOpen(Source)
	Exit Sub
	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

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...