Sometimes I come across an interesting configuration issue – this is one of them. SharePoint 2010 provides the capability to email documents to a document library. In order to configure SharePoint incoming email, SMTP has to be installed on the server first and incoming email enabled. If you encounter an error while attempting to enable SharePoint incoming email, check alternate access mapping URLs – mine had the Central Administration website configured with the shortname “portal” instead of the fully qualified domain name of “portal.metcorp.org”.
After enabling and configuring SharePoint for incoming email (including the OU where contact objects are created by SharePoint), it is possible to configure a SharePoint document list with an email alias. If the SharePoint service account doesn’t have appropriate rights to this OU to create contacts (and groups), you will get an error attempting to configure a document library with an email alias.
Additionally, if the contact objects created by SharePoint aren’t configured with the following attribute values, emailed attachments are stripped:
- InternetEncoding = 1310720
- MapiRecipient = False
Here’s some PowerShell code to automatically set these values on SharePoint managed contacts (you have to configure the OU in the code in which SharePoint creates the contacts):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | Import-Module ActiveDirectory $SharePointContactsOU = "OU=Contacts,OU=SharePoint,OU=Enterprise,DC=metcorp,DC=org" Write-Output "Getting a list of contact objects in the SharePoint OU ($SharePointContactsOU) `r " [array]$SharePointContacts = Get-ADObject -filter { ObjectClass -eq "contact" } -SearchBase $SharePointContactsOU -property DisplayName,targetAddress,internetEncoding,mapirecipient [int]$SharePointContactsCount = $SharePointContacts.Count Write-Output "Attempting attribute update of the $SharePointContactsCount contact object(s) in the SharePoint OU ($SharePointContactsOU) `r " ForEach ($Contact in $SharePointContacts) { ## OPEN ForEach $Contact in $SharePointContacts $ContactName = $Contact.name $ContactDisplayName = $Contact.DisplayName Write-Output "Updating attributes on the contact object: $ContactName (DisplayName: ;$ContactDisplayName) `r " TRY { Set-ADObject $Contact -replace @{ "internetEncoding" = "1310720" } } CATCH { Write-Warning "An error occured while attempting to update the attribute internetEncoding with the value of 1310720 " } TRY { Set-ADObject $Contact -replace @{ "mAPIRecipient" = $false } } CATCH { Write-Warning "An error occured while attempting to update the attribute mAPIRecipient with the value of false " } [array]$ContactObjectInfo = Get-ADObject $Contact -property DisplayName,targetAddress,internetEncoding,mapirecipient IF ($ContactObjectInfo) { $ContactObjectInfo ; Write-Output " `r " } } ## CLOSE ForEach $Contact in $SharePointContacts |