Hi There,
Have you considered doing a simple directory query for each user? Here is
simple code I put togeather into a function in VB.NET togeather and this may
help ya:
Private Function FindListOwner(ByVal Name As String) As DirectoryEntry
'################################################# ##############
'# This will return the requested user using the email address
'################################################# ##############
Dim entry As New DirectoryEntry("LDAP://domain.com")
Dim mySearcher As New System.DirectoryServices.DirectorySearcher(entry)
Dim result As System.DirectoryServices.SearchResult
mySearcher.Filter = ("(&(Mail=" & Name &
"*)(objectClass=user)(objectCategory=person))" ) 'lookup a users rdn using
the begining of their email address
For Each result In mySearcher.FindAll()
Return result.GetDirectoryEntry
Next
End Function
If it doesnt find anything, then it doesnt exist.
-Timothy
"Sterling Anderson" <sa*******@nospam.hbs.net> wrote in message
news:eW*************@tk2msftngp13.phx.gbl...
I have a customer who has a virus/spam application that registers a couple
event sinks with SMTP to check for virus infected or spam email. Right now
all the email that meets the "bad" criteria gets relayed to a catchall
mail account. Any email that passes the tests gets relayed to the real SMTP
server. The problem is, the "bad" email includes email to nonexistant
accounts at the company.
What I am in need of is an event sink that does a directory lookup with
each email and if the user is not in the domain or active directory user list
then the mail should be sent back to the sender with the standard
"relaying not allowed" error.
Can anyone help me out with this? I think I understand the whole event
sink idea but I cannot find resources on doing the user lookup.
Thanks in advnace.
--
Sterling Anderson
sa*******@hbs.net