views:

480

answers:

1

SO ... here is the scenario ... i have a workflow on a document library that copies a file to a windows directory ... this workflow is set to be started at the time when a new item is added to the document library ... so everything works fine when you are manually uploading files to the doc library ... but the problem occurs when we use emails to populate the doc library instead of the manual uploading of files. When an email is received ... the workflow starts successfully and runs properly (i have kept workflow history entries to check every section of code is being executed or not) ... the workflow stops when the section where the file is being copied to the windows folder is reached.

I basically think this is a problem with the permissions or access issues. Because when we upload the file manually (i.e. from doc library > upload) everything works fine. But maybe there is some other permission set which is used while an email is received by the doc library ... i have tried by assigning permissions to "Everyone" on the windows folder ... but no luck...

Can someone let me know which windows user account is used when an email is received by a document library? (i think its the IIS default account - but isnt it included in Everyone?? )

One solution which i can devise in my mind is that for the file transfer to the windows folder i should use temporary impersonation for the specific code segment (which writes the doc library file to windows folder) but any suggestions are welcome.

P.S. I dont have access to the server right now so i can only devise approaches in my mind ... cant test them right nw... so it would be good to have all suggestions u have so that once i get the access i can try all stuff :D

A: 

This is a well known situation. The system does not know who sent the email so it cannot impersonate a user it has no knowledge about.

Depending on which version of SharePoint you are running, the workflow may not start at all or it may start under the account that published the workflow.

For details see this Microsoft Support Article.

Muhimbi
actually the workflow does start when the email is received...the problem is that it completes the first two steps and then halts in the step where the file transfer (from doc library to windows folder) ... plus it was published using a site collection administrator...
ria
What are you using to copy the file to the windows directory from the workflow, a custom activity? If you have the code for this activity then put a breakpoint in it and see what is going on. Alternatively use something like Sysinternals Process monitor to see what is going on when it is trying to write to the file system. Is there any exception handling / logging of errors in your code?
Muhimbi