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