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;
}