c# - Getting sender IP address from Exchange Server 2003 using WebDAV -
i wrote application our company process newsletter signup requests via signup emails sent inbox on our exchange 2003 servers using webdav. works fine.
now we've realized auditing purposes, need capture ip address of signup request originated. question is, there way request original ip address of originator of email webdav request?
i've browsed through urn:schemas:mailheader: , urn:schemas:httpmail: documentation , didn't see field can request data besides maybe urn:schemas:mailheader:path. when make request our exchange server path
in request, status property comes 404 not found.
it looks http://schemas.microsoft.com/cdo/smtpenvelope has clientipaddress
property have information, applicable messages still in transit.
has had before , figured out way snag ip address of user originated email? isn't helpful question, format of webdav request 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"" scope('shallow traversal of ""{0}""') ""dav:isfolder"" = false , ""urn:schemas:httpmail:read"" = false </d:sql> </d:searchrequest> ";
this comes smtp more comes exchange/webdav. depends on email service end user using. smtp can pass email around multiple times before ends @ destination. normally, each hop adds received: from
header, additional information ip address.
but, services, google, don't count user sending email has hop, , originating ip address google smtp server. you'll never know end user ip address email. then, other services may count end user's public ip address first hop. , other services may add special header x-sender-ip
or x-originating-ip
message.
so, there isn't guaranteed way obtain information. part of has distributed nature of smtp, prevalence of webmail , privacy concerns. if information critical auditing, may want setup simple webform send email inbox, , add additional information ip address body of email.
Comments
Post a Comment