0

I recently wrote an application for our company to process newsletter signup requests via signup emails sent to an inbox on our Exchange 2003 servers using WebDAV. This all works fine.

Now we've realized that for auditing purposes, we need to capture the ip address of where the signup request originated. My question is, is there a way to request the original ip address of the originator of the email with my WebDAV request?

I've browsed through the urn:schemas:mailheader: and the urn:schemas:httpmail: documentation and didn't see a field you can request with this data besides maybe urn:schemas:mailheader:path. But when I make a request to our exchange server with the path in the request, the status for that property comes back 404 not found.

It looks like http://schemas.microsoft.com/cdo/smtpenvelope has a clientipaddress property that would have this information, but that is only applicable to messages still in transit.

Has anyone had to do this before and figured out a way to snag the ip address of the user who originated the email? It probably isn't helpful to the question, but the format of my WebDAV request is below:

string webdav =
    @"
    <?xml version=""1.0""?>
    <D:searchrequest xmlns:D = ""DAV:"">
        <D:sql>
           SELECT 
                ""DAV:displayname"", 
                ""urn:schemas:httpmail:fromemail"",
                ""urn:schemas:mailheader:subject"", 
                ""urn:schemas:httpmail:textdescription"",
                ""urn:schemas:mailheader:date""
           FROM 
                SCOPE('shallow traversal of ""{0}""')  
           WHERE
                ""DAV:isfolder"" = false AND 
                ""urn:schemas:httpmail:read"" = false
        </D:sql>
    </D:searchrequest>                 
    ";
4

1 回答 1

0

这更多地回到 SMTP,而不是 Exchange/WebDAV。这实际上取决于最终用户使用的电子邮件服务。SMTP 可以多次传递一封电子邮件,然后才能到达目的地。通常,每个跃点都会添加一个Received: from标头,以及一些附加信息,例如 IP 地址。

但是,一些服务,如谷歌,不计算发送电子邮件的用户有一个跃点,并且原始 IP 地址是一个谷歌 SMTP 服务器。因此,您永远不会知道电子邮件中的最终用户 IP 地址。然后,其他服务可能会将最终用户的公共 IP 地址计为第一跳。并且一些其他服务可能会在消息中添加一个特殊的标头,例如X-Sender-IPX-Originating-IP

因此,没有保证获取该信息的方法。部分原因与 SMTP 的分布式特性、网络邮件的流行和一些隐私问题有关。如果此信息对您的审核至关重要,您可能需要设置一个简单的网络表单,该表单可以向此收件箱发送电子邮件,然后您可以在电子邮件正文中添加 IP 地址等附加信息。

于 2014-06-27T15:55:48.957 回答