We have an unusual setup in our Active Directory where the user is kept in one OU with his corporate email address. His primary email (which is different from his corporate email) is stored in a different OU.
For example, their user credentials are in:
OU=Users,OU=DEPARTMENT,OU=DIVISION,OU=CORP,DC=ds,DC=company,DC=com
using this to get email gets the email address they are not supposed to use. We need to get that address from:
OU=CONTACTS,OU=MAIL ADDRESSES,OU=CORP,DC=ds,DC=company,DC=com