What Fields Comprise The E-Mail Header?

I have a situation where I need to forward the header of an E-Mail to an ISP. (E-Mail fraud situation.) We only use Domino mail, POP3 is not enabled.

I would like to gather the header information in a manner like MS Outlook displays E-Mail header information upon demand.

Is that possible? If so, what fields of the E-Mail message do I need?

I’m thinking about creating an Action button for the Lotus Notes client that will create a pop-up window displaying the E-Mail Header information. I looked for, but could not find, any forum or Sandbox code for that purpose.

There are so many fields on the E-Mail Memo, I don’t know what I need. If I know the necessary fields, I can write the code.

Thank you for the help.

David R. Noble

Subject: What Fields Comprise The E-Mail Header ?

In Notes 6 client, assuming you are using native MIME (if not, why not?), open the email you wish to see headers for and use menu option View, Show MIME Source. Header fields are everything down to the first blank line. Example (slightly munged):

Received: from open.relay ([192.168.0.1])

      by domino.host (Lotus Domino Release 6.0.1CF1)

      with SMTP id 2003092404205363-140 ;

      Wed, 24 Sep 2003 04:20:53 +0100 

Received: from spammers.computer (HELO wz46m) [10.0.0.1] by open.relay id <2556260-14426>; Wed, 24 Sep 2003 02:11:44 -0200

Message-ID: xxxxxxxxxxxxxxxxxxx@xxxxxxx

From: “Spammer” <spammers_email_address>

Reply-To: “Spammer” <spammers_email_address>

To: victims_email_address

Subject: Private and confidential - medication on-line xxx aliasxxxxx

Date: Wed, 24 Sep 03 02:11:44 GMT

X-Mailer: Microsoft Outlook Express 5.50.4133.2400

MIME-Version: 1.0

X-Priority: 3 (Normal)

X-MSMail-Priority: Normal

X-MIMETrack: Itemize by SMTP Server on Server/NotesOrg(Release 6.0.1CF1 | March 06, 2003) at

24/09/2003 04:20:58,

	 Serialize by Notes Client on User/NotesOrg(Release

6.0.2CF2|July 23, 2003) at 24/09/2003 10:45:02,

	 Serialize complete at 24/09/2003 10:45:02

Content-Type: multipart/alternative;

	 boundary="AFD39152.0.FEE_9.D_B32C6"

Subject: RE: What Fields Comprise The E-Mail Header ?

Excellent! I had no idea that feature was available. Thank you very much.

Subject: What Fields Comprise The E-Mail Header ?

Try the following as a starter:

Sub Initialize

Dim s As New NotesSession

Dim db As NotesDatabase

Dim dc As NotesDocumentCollection

Dim doc As NotesDocument,tempdoc As notesdocument

Dim m As String, n As String

Dim first As Integer, l As Integer



l = 1

Set db = s.CurrentDatabase

Set dc = db.UnprocessedDocuments

Set doc = dc.GetFirstDocument

While Not(doc Is Nothing)

	'' create a temporary copy of the document

	Set tempdoc = db.createdocument

	Call doc.CopyAllItems( tempdoc )

‘’ re-read the document items to ensure you are getting the remaining fields and not the removed ones

NextOne:

	Forall item In tempdoc.Items

		If item.Name = "Received" Then

			m = item.Text

			first = False

			For a = 1 To Len(m)

				If ( Mid$(m,a,5) = "     " ) Then

					If ( first = False ) Then

						Mid$(m,a,1) = Chr$(10)

						first = True

					Else

						Mid$(m,a,1) = " "

					End If

				Else

					first = False

				End If

			Next

			If ( n = "" ) Then

				n = "<Hop " & l & ">"

				n = n & Chr$(13) & m

				l = l + 1

			Else

				n = n & Chr$(13) & "<Hop " & l & ">" & Chr$(13) & m

				l = l + 1

			End If

			m = ""

			'' remove the current occurrence of the item so lotusscript will get the next one

			Call item.Remove

			'' write the document so it will not contain the removed item

			Call tempdoc.save(True,True)

			'' go back and re-read the document items to refresh the memory

			Goto NextOne

		End If

		

	End Forall

	If ( n <> "" ) Then 

		Messagebox n,,doc.Subject(0)

	Else

		Messagebox "No Internet Received Headers found.",,doc.Subject(0)

	End If

	n = ""

	'' delete the temporary document

	Call tempdoc.Remove( True )

	Set doc = dc.GetNextDocument(doc)

Wend	

End Sub

Subject: RE: What Fields Comprise The E-Mail Header ?

Wow. That’s very, very similar to what I was looking to do. You just saved me a load of time. Thank you.

Subject: RE: What Fields Comprise The E-Mail Header ?

You’re welcome :slight_smile:

Disclaimer: The code isn’t mine, and I don’t claim ownership of it. I do, however, know that it works. I found it posted in the forum some time ago when trying to solve exactly the same problem, and am just re-posting it here. If you recognise it as yours, then you have my heartfelt gratitude :slight_smile:

Stephen Lister

Subject: In Notes 6 try “view - show - page source”