how to get the ipaddress from where each mail is sent in lotus notes

Phoenix

Suppose i have a mail in my lotus notes,Now i have to get from which IP address that mail is sent.How do i get the IP address in domino designer through java.Is there any header information from which i can get the IP Address.

I tried looking in the properties of the document but i could not find anything in there apart from which server i got the mails Please help.

Knut Herrmann

A Notes mail document has an item "Received" which contains information from every server it has passed. You can't find out client's IP address this way (I think that's impossible) but you get the server's IP address at least.

It is not that easy to get ip address from item "Received" though because there are several items "Received" and with document's methods you always get only the last created. As a workaround you have to read item and remove item in a cycle so that you get all items "Received". Here is the Java code for getting the ip address closest to sender:

private String getIPSender(Document doc) {
    String ip = "";
    if (doc != null) {
        try {
            while (doc.hasItem("Received")) {
                Item item = doc.getFirstItem("Received");
                if (item.getValueString().contains("[")) {
                    ip = item.getValueString();
                }
                item.remove();
            }
            if (!ip.isEmpty()) {
                ip = ip.substring(ip.indexOf("[") + 1);
                ip = ip.substring(0, ip.indexOf("]"));
            }
        } catch (Exception e) {
            ip = "";
        }
    }
    return ip;
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Sent mail in Lotus Notes

How to get the original of the e-mail in Lotus Notes 8.5?

Lotus Notes - get mail database of current user

Create a view from Lotus Notes mail search

Lotus Notes : Run agent to send mail from app

How to search in e-mail BODY in Lotus Notes 8.5.2?

How to get messages sent with the `array` mail driver?

Get .txt file from Lotus Notes document using Java

Lotus Notes get value from rich text to a text field

Lotus Notes: Add clickable telephone number to mail

How to get document when I select a document in IBM Lotus Notes

How to get author of a Notes document using lotus script?

How to check browser ver/name from Lotus Notes Java agent?

How to redirect to an HTML classic asp page from Lotus notes form

How to prevent Lotus Notes from saving a document created by a DXL Import?

How to download attachments from lotus notes using vb script

How to convert .nsf (IBM Lotus Notes) to .pst (MS Outlook) or other mail client format

How do I mark mail as read in Lotus Notes without actually opening the email?

vba code for copying body of a stationery mail into a new mail in lotus notes

How to forward mails in lotus notes

Where are the javadocs for Lotus' Notes.jar?

How to get a type from a union where each type has an id

Lotus Notes - determining actual sent-to address.

How to export Notes Document(email,task,etc.) from Lotus notes Client 8.5 into DXL File?

Lotus Notes JavaScript Get user info

PHP mail() function and Lotus Notes client: HTML damaged

VB macro to send mail without opening Lotus notes

Lotus notes - refering to a doc. from a NotesDocumentCollection

Lotus Notes - open a file from Action Button