Thursday, 16 July 2009

Document Libraries, Inbound Email and Workflows in SharePoint

So up until a week ago I had never installed SharePoint and never really used it. But needless to say that didn’t stop me installing it and trying to get it working.

Well everything worked fine, inbound emails in to SharePoint were working and being stored in document libraries correctly and then I tried to be clever and use a custom workflow (although I believe this problem is with standard workflows as well). I wanted the workflow to run when an email was received by the Document Library.

It turns out that since SP1, there was a “Security” Enhancement that stops the System Account from running the Workflows and since incoming emails are processed and then items created as the System Account the workflows do not run.

There is a patch for SP1 to fix this and the patch is rolled into SP2, but you have to run a command to get it all working. The fix sets the workflow to run as the user that linked the workflow to the Document Library.

This information is provided in various KB articles which are linked to from several forums but since I have spent far too long searching for it I thought I would post about it here, so if nothing else I know were to look next time.

You need to run the following command, the stsadm tool can be found in %COMMONPROGRAMFILES%\microsoft shared\web server extensions\12\bin

stsadm -o setproperty -pn declarativeworkflowautostartonemailenabled -pv true

KB article 953289 provides details of this along with a link to the hotfix for SP1 users.

No comments:

Post a Comment