109

Nintex Workflow 2010 ‘Task Reminder’ Bug & Fix

This morning I came across the following error while trying to publish a Nintex 2010 workflow which contains a ‘Task Reminder’ workflow action.


Background:
I have a SharePoint 2010 MOSS environment. I create a new Nintex 2010 Workflow which I can save and publish without problems.


Then I add a ‘Task Reminder’ action

image


And when I publish the workflow I get the following error:

image

Cause:
For a type to be used within the workflow, it must be registered as an Authorized Type in the web.config file. All of the Nintex workflow actions and custom types are registered as authorized types.
Some of the workflow actions have a property of a type that inherits from a generic list, that is List<T>. List<T> is a basic system type provided in .NET.
With SharePoint 2010, List<T> is no longer authorized. Workflow actions that use a type that inherits from List<T> no longer run or publish.
The SharePoint web service to validate workflows returns the following error when publishing:
<Error><CompilerError Line="0" Column="0" Text="Type System.Collections.Generic.List`1, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is not marked as authorized in the application configuration file." /></Error>

Work around:
Add the following to the web.config of the SharePoint web application on which you want to publish the workflow.

<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Collections.Generic" TypeName="List`1" Authorized="True" />

Save the web.config and return to SharePoint and now you will be able to successfully publish the same workflow (containing the Task Reminder):

10

SharePoint 2010 Incoming e-mail Settings on Windows 7

Recently I needed to enable a SharePoint 2010 document library to accept incoming emails and then use the data from the body of the email to update list values.
It is really easy to configure SharePoint 2010 for incoming email and to enable a specific document library to receive emails.
You will find a few good tutorials on the web to help you achive this.
One of the very first things which you need to do is to install and configure a SMTP service on your SP2010 web front-end server. That is exactly where I ran into problems as my SP2010 web front end server is running on Windows 7.
Unfortunately Windows 7 does not ship with SMTP Service and almost all the documentation showing how to configure your SP2010 WFE for incoming mail focus on Windows 2008 server.
Many thanks to Wesley Bakker for the clear and helpful instructions which he posted at http://weblogs.asp.net/wesleybakker/archive/2010/08/09/configure-hmailserver-for-sharepoint.aspx
This short tutorial will illustrate how I managed to get my SharePoint 2010 incoming email configured on my Windows 7 web front-end server.
1. Download hMailServer from http://www.hmailserver.com/
2. Install hMailServer and create a new Administrator password when prompted.
3. Configure hMailServer in the following way:

(If I do not specify a setting to be changed then accept the default)
  • After the install completed, add a new domain. You can use anything.
  • In the new hMailServer domain create two new email accounts
clip_image002
  • Expand Settings and click on SMTP. Set the ‘Local host name’ to your local machine name.
clip_image004
  • Expand ‘Advanced’ and then expand ‘IP Ranges’ and click on ‘Localhost’. I changed the Name, Lower IP, Upper IP values and I removed the requirement for SMTP authentication.
clip_image006 
  • Because hMailServer does not have an email drop folder by default, you have to create a folder structure to use as a drop folder. I created the following folder structure to use as my drop folder:  C:\Program Files (x86)\hMailServer\Data\JohanSPSDev.local\Dropfolder\
  • Microsoft SMTP server adds header information to emails which hMailServer does not do, so if the information is missing SharePoint will not accept the emails into the library. So in order to prevent this you need to add a script to hMailServer to include the header information into the emails before there are dropped into the drop folder for SharePoint.
  • This process is very clearly explained by Wesley Bakker in his post: http://weblogs.asp.net/wesleybakker/archive/2010/08/09/configure-hmailserver-for-sharepoint.aspx
      • In hMailServer expand ‘Advanced’ and then click on ‘Scripts’.
      • Enable Scripts and click on Show Scripts. Open the existing script file in notepad and add the following text.
      • Ensure to change the drop folder path to your own configuration.
      • After you made the changes save the file and close it.
      • Back in hMailServer click on ‘Check syntax’ and then on ‘Reload scripts’.
      clip_image008
      4. Test your SMTP Service:
      • Now our hMailServer should be up and running and we are ready to test whether we can send and receive email… because I also have a corporate email account and I have Outlook installed the easiest for me was to create a POP account in Outlook and point it to my new domain.
      clip_image010
      • The important thing here is to use an IP address of your local machine instead of using the word localhost or even your pc name. I tried my pc name as well as localhost but when I tested the account settings it kept failing… I only got it to work after I provided the IP address.
      • After I finished configuration of my POP3 account in Outlook I received the following test email in my inbox as confirmation that my SMTP service is working fine
      clip_image012
      • So now that our SMTP Service is working the next step is to configure SharePoint.
      • Open Central Administration and go to System Settings.
      • Click on ‘Configure incoming e-mail settings
      clip_image014
      • Set ‘Enable sites on this server to receive e-mail’ to ‘Yes’
      • Ensure that you change the e-mail server to match that of the new domain which you created in hMailServer and specify the drop folder which you manually created earlier.
      • Click on OK to save your settings.
      clip_image016
      • To test that it is working create a new SP2010 document library and go to the library settings. Click on ‘Incoming e-mail settings’
      clip_image018
      5. Configure the Incoming e-mail settings for the library:
      • Configure the Incoming e-mail settings for the library as illustrated in the screenshot below and click on ‘OK’ to save the settings. Note that I specify an e-mail address which of an account which I created in hMailServer earlier.
      clip_image020
      6. Test Everything:
      • Go back to Outlook and select the new POP3 mailbox. Create a new email to be sent from this account and send a test email to the email address of the document library and send the email.
      clip_image022
      • After outlook performed a send-receive and the email is in your ‘sent items’ go to SharePoint and refresh the document library.
      • If everything went well you should see the new email in you library.
      clip_image024
      Note that when a library is configured to accept incoming email SharePoint will automatically add new columns to the library, but the new columns is not automatically added to the default view..so you can modify the view to see the additional information from the email:
      clip_image026
      You will also notice that the body of the email is not available as a column.
      It is very easy to extract the body information by using an eml reader class. I will how you how to do this in a separate post.
      Keep in mind that your environment might be very different than mine and there can be a million things configured which might have an impact on getting this to work for you. My anti-virus was not a problem and my hMailServer service was automatically started.
      I hope this post will help you to get incoming e-mail configured for SharePoint 2010 on a Windows 7 machine.
      Have fun!!