Is there a way to get the user name or the SPUser object by passing the mail address for a user, which is not already known by the site?
I know I can get the SPUser by using
SPSite.AllUsers.GetByEmail(emailAddress);
But this only works if the user is already known in the site collection. Does SharePoint (with C# Server Object Model) provide a way to search a user in the Active Directory by its mail address or do I have to use System.DirectoryServices and search in the Active Directory for myself?
Use Case:
I have a mail event receiver for a document library people can send mails to. I have some logic and at the end I want to save the attachments to this library. The Author property of the item (which is now set to SystemAccount) should be set to the person who sent the email.