Posted on:
Categories: SharePoint;PowerShell
Description:

Symptoms:

After upgrading to SharePoint 2013 from SharePoint 2010, you notice that incoming email is not working. You can see that incoming emails are appearing in the drop folder of the server that you have configured to receive incoming emails, but they are never processed.

Solution:

You can manually toggle incoming email on and off for each list that is configured to receive incoming email; however, if you have a lot of lists that are configured to receive incoming email, this is not a practical solution.

The following PowerShell script will check all lists in your farm and essentially toggle incoming email off and on, which should resolve this issue.

$sites = Get-SPSite -limit all
foreach($site in $sites){
 foreach($web in $site.Allwebs){
  foreach($list in $web.lists){
   if(($list.CanReceiveEmail -eq "True") -and ($list.EmailAlias -ne $null)){
    Write-Host $web.Url
    Write-Host -foregroundcolor Green $list.Title
    Write-Host -foregroundcolor Yellow $list.EmailAlias
    $alias = $list.EmailAlias
    $list.EmailAlias = $null
    $list.Update()
    $list.EmailAlias = $alias
    $list.Update()
   }
  }
 }
}