Partilhar via


How to deal with an error in configuring 'Incoming E-mail settings'?

Let me start with my first technical post about Email enabled Lists or Email enabled Document Libraries:

Symptoms:  

Consider one fine day you decide to use e-mail enabled lists in SharePoint 2007.  Then you configure "Incoming E-mail Settings" in the Central Administration Page [related information is here: https://technet.microsoft.com/en-us/library/cc288433.aspx]. You select 'Yes' for the option 'Use the SharePoint Directory Management Service to create distribution groups and contacts? ' and provide necessary information like Organization Unit (OU) and Domain Controller (DC).

After completing the configuration, you start to configure a document library or a list to make it to accept incoming e-mails. Once you click OK button for that page, you may receive the following in the web page:

Error

Error in the application

You check application event log and you may not see any specific entry for this error.

Then you look into the SharePoint ULS log and you may find this entry:

Application error when access /_layouts/EmailSettings.aspx, Error=Error in the application.
at Microsoft.SharePoint.SPList.UpdateDirectoryManagementService(String oldAlias, String newAlias)
at Microsoft.SharePoint.SPList.Update(Boolean bFromMigration)
at Microsoft.SharePoint.SPList.Update()
at Microsoft.SharePoint.ApplicationPages.EmailSettingsPage.SubmitButton_Click(Object sender, EventArgs args)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

If you disable custom errors for the associated web application in its web.config file, you may get the web page with this information:

Error in the application. at Microsoft.SharePoint.SPList.UpdateDirectoryManagementService(String oldAlias, String newAlias)
at Microsoft.SharePoint.SPList.Update(Boolean bFromMigration)
at Microsoft.SharePoint.SPList.Update()
at Microsoft.SharePoint.ApplicationPages.EmailSettingsPage.SubmitButton_Click(Object sender, EventArgs args)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

NOTE: Sometimes this issue may occur when you try to disable Incoming e-mail settings option for a document library or a list.  To resolve the issue at that times, follow "For Situation 3:" in the section "How to resolve these situations?".

Why do we get this erro?

Situation 1. Application pool account that is used for the Central administration may be different from that of the web application on which you configure incoming e-mail settings.

This situation may also happen:

- if you had both Central admin and Web application service in a server

- and you moved the Central admin to a different server after some time.

In this situation, you may have two different application pool accounts for the Central admin. and for the web app (obviously in different machines). Let us say the boxes as:

Box A = Central admin. = AppPoolAccount-X
Box B = Web application = AppPoolAccount-Y

Situation 2. Your active directory may not have these attributes in it:

ms-Exch-mail-Nickname and
ms-Exch-RequireAuthToSendTo

Situation 3. The application pool account that is used for the Central admin. may not have necessary permissions in the Active Directory to create or delete objects.

How to resolve these situations?

For Situation 1:

Method 1:  If Central admin and the related web application are in the same server:

Change the application pool account to be the same for both Central admin. site and the web application.

Method 2: If Central admin. is in a different server:

1. Enable the "Windows SharePoint Services Web Application" service via the "Services on Server" on the box running the Central Admin service.

2. Create a new dummy application pool on the Box A running Central Admin and set it to run using AppPoolAccount-Y. Note that this application pool does not need to be associated with any virtual server in IIS.

For Situation 2:

This situation normally occurs if Exchange 2003/2007 is not installed [properly] in the DC.

So, how to verify whether the required attributes are available?

- Logon Domain Controller. Install Windows support tools from SUPPORT\TOOLS folder of Windows installation CD.

- Click "Start" >"Run"; type "adsiedit.msc" (without quotes).

- Expand Node Schema and click "CN=Schema, CN=Configuration,DC=Name-of-DC,DC=com".

- Search if you can find two attributes "CN= ms-Exch-mail-Nickname" and "CN= ms-Exch-RequireAuthToSendTo".

If the attributes are not available, running the setup of Exchange with setup/forestprep will automatically register the required two attributes in the active directory.

For Situation 3:

To be able to enable an email enabled list when using the "Directory Management Service" in WSS/MOSS 2007, the application pool account used for the Central admin. should have delegated Full Control of the OU that is to be used for creating contacts for SharePoint in the Active Directory.

To delegate Full Control for the application pool account, follow these steps:

1. In 'Active Directory Users and Computers' , right click on the required OU and select "Delegate Control".
2. Click Next and then click Add.
2. Enter the account name that is used as the app. pool account the Central Admin site and then select OK.
3. Select Next;then select the "Create a custom task to delegate" radio button. Select Next.
4. Select "This folder, existing objects in this folder, and creation of new objects in this folder" radio button if required. Select Next.
5. In the Permissions section, select these permissions:

"Create all Child Objects" and 

"Delete all Child Objects"

6. Click Next and then click Finish.

With the above setting you may be able to enable email on a list but you will fail when attempting to disable it. Then, what are we missing here?

The failure is due to the fact that we are attempting to delete the contact from the OU. To resolve the failure when disabling the email you will need to add one additional right to the admin account

Now let us see how to set the security options for the OU:

1. In Active Directory Users and Computers, select View menu and select "Advanced Features" if it is not selected.
2. Right click on the required OU and select Properties.
3. Select the Security tab and then select the Advanced button.
4. From the Permission Entries section, double-click on the application pool account that you delegated rights as mentioned above.
5. Select the option "Delete Subtree" that is listed under Permissions.
6. Click OK twice; then restart IIS on the SharePoint box.

Thanks for visiting my blog! - Jagadeesh. P

Comments

  • Anonymous
    April 22, 2009
    I was blocked because this error. It worked for sites in one SSP but not in the other. I changed app pool identity as you propose and solved!!! Great detailed info!!!!!!! Thanks a lot

  • Anonymous
    May 01, 2009
    Excellent information!  You solved my problem. Thanks a bunch.

  • Anonymous
    May 07, 2009
    Fantastic -- the solution for situation 3 hooked me up!!!  I really appreciate it!

  • Anonymous
    August 24, 2009
    Solution 3 fixed my problem too!  Thanks for taking the time to post this for the benefit of others!

  • Anonymous
    March 23, 2010
    YEAH! Solution 3 was the ticket for me....I was living with this for a long time.  Thanks!

  • Anonymous
    September 22, 2010
    Awesome tips but sad it doesnt work for me. I get another type of error. "System.Net.WebException: The request failed with HTTP status 401: Unauthorized. " if you have any clue, please comment at this thread social.msdn.microsoft.com/.../dd1cb7ac-3381-4783-abb0-f8b8e84598d4

  • Anonymous
    April 20, 2011
    Thanks! I did number 3 on my 2010 environment when I was getting errors trying to turn off incoming e-mail from a list, and it worked like a charm once I reset IIS.

  • Anonymous
    July 14, 2012
    Much appreciated, I was having trouble disabling incominf email from a Doc Lib. Dozens of places had the same info, except for the final part in Situation 3 (the Delete Subtree task). That was what I needed, so thank you

  • Anonymous
    July 22, 2013
    Kindly appreciated, saved me several hours and a headache !

  • Anonymous
    August 22, 2014
    Situation 3 was really tricky ! You saved my afternoon.

  • Anonymous
    May 09, 2017
    amazing post!