There is no way I can make it perfect, if you use more than one scheme for your own users then no matter what I do it will guess wrong for some users.
Here is what I'm implementing for the next version:
private string GuessEmailAddress(string userName)
{
if (WebConfigSettings.GuessEmailForWindowsAuth)
{
if (userName.Contains("/"))
{
string domain = userName.Substring(0, userName.IndexOf("/"));
string user = userName.Replace(domain, string.Empty).Replace("/", string.Empty);
return user + "@" + domain + WebConfigSettings.WindowsAuthDomainExtension;
}
}
return string.Empty;
}
Where WindowsAuthDomainExtension will default to .com
Best thing to do would be to tell users they need to update their email address under My Account the first time they use the site.
Best,
Joe