简体   繁体   English

如何从莲花笔记中发送每封邮件的地方获取ipaddress

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

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. 假设我的莲花笔记中有一封邮件,现在我必须从哪个IP地址获取邮件发送。如何通过java获取多米诺设计师的IP地址。是否有任何标题信息,我可以从中获取IP地址。

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. 我试着查看文档的属性,但我找不到任何东西,除了我收到邮件的服务器请帮忙。

A Notes mail document has an item "Received" which contains information from every server it has passed. Notes邮件文档有一个“已接收”项,其中包含已通过的每个服务器的信息。 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. 您无法通过这种方式找到客户端的IP地址(我认为这是不可能的)但您至少可以获得服务器的IP地址。

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. 从“已收到”项目获取IP地址并不容易,因为有几个项目“已接收”,并且使用文档的方法,您始终只获得最后创建的项目。 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: 以下是获取最接近发件人的IP地址的Java代码:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Java API从Lotus Notes文档获取精确邮件地址? - How to get the Exact Mail Address from Lotus Notes Document Using Java API? 如何阅读Lotus Notes邮件存档(* .nsf) - How to read Lotus Notes mail archives (*.nsf) 如何阻止Lotus Notes用户转发或复制通过Java中的Notes.jar API发送的消息? - How do I prevent Lotus Notes users from forwarding or copying a message sent via Notes.jar API in Java? 莲花注释:通过ColumnName从ViewEntry获取值 - lotus notes : get value from ViewEntry by ColumnName 从lotus notes数据库中获取表名 - Get table names from lotus notes database Lotus Notes-邮件文档-获取附件名称(和导出附件) - Lotus Notes - Mail Document - Get Attachment Names (and Export Attachments) Lotus Notes-邮件文档-Principal / From,INetFrom,SentTime,ReceivedTime字段 - Lotus Notes - Mail Document - Principal/From,INetFrom, SentTime, ReceivedTime fields 无法从Lotus Notes中的邮件正文检索内联图像 - unable to retrive inlines images from the mail body in Lotus Notes 如何在IBM Lotus Notes插件中捕获“发送邮件” - How to capture “send mail” in plugin for IBM Lotus notes 如何从Lotus Notes启动应用程序,然后再保存到Lotus数据库中? - How to launch an application from Lotus Notes, then later save into Lotus database?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM