Der SMTP-Header einer Mail

  • Hallo zusammen,



    hat eigentlich irgendjemand eine Idee, wie ich an den Mail-Header einer Mail komme?
    Wenn ich eine Mail aus dem Internet in meinem Notes (5.x oder 6.x) empfange müsste doch irgendwo diese Info versteckt sein.
    Nur wo?
    Die ganzen Felder in dem Dokument helfen mir zunächst mal nicht weiter.


    cu


    Jörg

  • Guck Dir mal im Download-Bereich folgende Themen an:


    -> OpenNTF (neue Mailschablone für R6, da gibts ein Button für "zeig mir den HEader")
    -> Field-Control (zeigt Dir alle Felder der Mail überschtlich auf, inkl. der Header-Felder)


    Beide DL´s sind kostenlos, insbesondere Field-Control kann ich nur empfehlen !

  • Aus der Lotus Knowledgebase...
    The following instructions explain how to write an agent in the mailfile that will take the SMTP header information from the selected email and send it in a new email to a specified address.


    The SMTP information included with this script are MIME_Version, SMTPOriginator, From, SendTo, CopyTo, BlindCopyTo, and the Received fields.


    Steps to use the agent:


    To use the agent, select an email from the view or open the email that you would like to extract the header information from and then go to the actions menu. Whatever you named the agent should be listed there. Click on it. The script will put the header information into a new email and send it to your email address. You can then review that the information was created correctly and forward it off to your Spam team.


    IMPORTANT NOTE: The following is a sample script, provided only to illustrate one way to approach this issue. In order for this example to perform as intended, the files must be laid out exactly as indicated below. Notes Support will not be able to customize this script for a customer's own configuration. While this has worked for many customers, it is offered as a suggestion only, and is not something that Lotus supports further.


    Steps to create the agent:


    1. Open your mail file and go to the Create menu and then select Agent from the menu (if you have Designer installed, Agent will be in the Design submenu).


    2. Give the agent a name such as "Send SMTP Header info".


    3. Leave the settings for 'When agent should run' to 'Manually from Actions Menu' and 'Which documents should it act on' to 'Selected Documents'.


    4. Under the Action section, select the dropdown menu to the right of 'Run' and select LotusScript.


    5. From the lower-left pane that has (Options), (Declarations), Initialize, and Terminate, select the Initialize subsection.


    6. Copy the following script to the clipboard and paste it into the Initialize sub in the agent so that the script lies in between "Sub Initialize" and "End Sub."


    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim dc As NotesDocumentCollection
    Dim doc As NotesDocument
    Set db = session.CurrentDatabase

    Dim newdoc As New NotesDocument( db )
    Set dc = db.UnprocessedDocuments
    Set doc = dc.GetFirstDocument

    ' create Body item for new memo and set the subject and form
    Dim rtitem As New NotesRichTextItem( newdoc, "Body" )
    Set item = doc.getfirstitem("Subject")
    If item Is Nothing Then
    item.text = "<no subject>"
    End If
    newdoc.Subject = "SMTP Header info for: " + item.text
    newdoc.From = "Memo"

    ' the next section grabs smtp header items from selected doc and places it into a new memo
    Set item = doc.getfirstitem("MIME_VERSION")
    If Not (item Is Nothing) Then
    Call rtitem.AppendText( "MIME_VERSION = " + item.text + Chr(10) + Chr(13) )
    End If

    Set item = doc.getfirstitem("SMTPOriginator")
    If Not (item Is Nothing) Then
    Call rtitem.AppendText( "SMTPOriginator = " + item.text + Chr(10) + Chr(13) )
    End If

    Set item = doc.getfirstitem("From")
    If Not (item Is Nothing) Then
    Call rtitem.AppendText( "From = " + item.text + Chr(10) + Chr(13) )
    End If

    Set item = doc.getfirstitem("SendTo")
    If Not (item Is Nothing) Then
    Call rtitem.AppendText( "SendTo = " + item.text + Chr(10) + Chr(13) )
    End If
    Set item = doc.getfirstitem("CopyTo")
    If Not (item Is Nothing) Then
    Call rtitem.AppendText( "CopyTo = " + item.text + Chr(10) + Chr(13) )
    End If

    Set item = doc.getfirstitem("BlindCopyTo")
    If Not item Is Nothing Then
    Call rtitem.AppendText( "BlindCopyTo = " + item.text + Chr(10) + Chr(13) + Chr(10) + Chr(13) )
    End If

    Set item = doc.getfirstitem("Received")
    Do Until item Is Nothing
    Call rtitem.AppendText( "Received = " + item.text + Chr(10) + Chr(13) + Chr(10) + Chr(13) )
    item.remove
    Set item = doc.getfirstitem("Received")
    Loop

    Call rtitem.AddNewLine( 1, True )

    ' sends the new memo to specified address and closes the open one
    Call newdoc.send( False, "PLACE EMAIL ADDRESS HERE")


    7. In the second to last line of the script, replace PLACE EMAIL ADDRESS HERE with your email address. Be sure to have the address within the quotes. As an alternative, if you want the email to go to the person running the agent, you can use the following code line instead:


    Call newdoc.send( False, session.username)


    8. Save the agent and close out of it.

  • ...hmmm, kann sein, daß ich extrem blind bin, aber...
    Wo soll die OpenNTF liegen??? Wo ist das Suchfenster wenn ich eingeloggt bin? Könnte man daß vielleicht direkt im Thread verlinken? ;)


    Ein leicht verwirrter Holja

    -----------------------------------------------------------------------------------------
    Warum sind die Dummen so selbstsicher, und die Klugen so zweifelnd?

  • Hi Matze,



    wir bekommen sporadisch bei uns Mails, die ziemlich suspekt adressiert sind.


    So nach dem Motto:


    Absender = customer@web.de und als Empfänger steht bspws. hans@mail.firma.de, wobei mail.firma.de der Hostname unseres Mailservers ist. Die kommen dann bei x-beliebigen Notesusern an.
    Irgendwo im Mailheader muss ich doch genauere Infos über die Mail rausholen können.


    cu


    Jörg

  • Ahh, das hört sich doch schon besser an.


    Also, wenn Du Dir die Properties einer solchen Mail mal genauer anschaust, dann findest Du dort schon genauere Informationen, z.B. im From Feld oder im SMTPOriginator Feld. Vorallem interessant sind die Received Felder. Auch informativ ist das Log, ich würde an Deiner Stelle einfach mal den Loglevel für´s Mailrouting höher drehen (über das Konfigurationsdokument einfach zu machen) und mir dann die Einträge etwas genauer anschauen, die Dir suspekt vorkommen.


    Hast Du eigentlich euren Server dicht gemacht, d.h. was z.B. das Relaying etc. betrifft. So kannst Du auch schon mal ein wenig was rausfiltern.


    Matze

  • Hi,



    jau, das mit dem relaying ist schon passiert. Wir haben einen Gatewayserver ins Internet (Linux mit postfix) und der übernimt diese Funktion.


    Obwohl ich in den Logs des Postfix und Notes nichts finde, kommen diese komischen Mails an. Aber dann werde ich mich bei der nächsten Mail mal in die Tiefen der Felder begeben. Eventuell besteht ja noch ein Unterschied in den Zeiten, so dass ich in den Logs an der falschen Stelle suche. =:(


    cu
    Jörg