May 052010

SharePoint outgoing mail to SharePoint incoming mail library

I was trying to submit an infopath form through infopath form services (browser) with an e-mail to an incoming mail library on a SharePoint in another domain. I noticed that the mail was appearing in the drop folder, and was beging deleted after a minute (TimerService) but it didn't get added to my library.


When i tried to send exactly the same mail from Outlook it worked like a charm. This problem gave me a couple of hours headache and then i found this Microsoft kb saying basicly it's not supported to prevent loops. So a mail coming from workflow / alert / form services is not allowed in incoming mails for a library.


Now the good news is that there is a solution to this which i found here .

Solution
1. copy Smtpreg.vbs into the c:\inetpub\AdminScripts - smtpreg is available to download from MS. (google it)
2. create a vbs file from the script below and copy it to the AdminScripts folder (I named mine wss)
3. run the following commands to register the script
cd c:\inetpub\adminscripts
cscript smtpreg.vbs /add 1 OnArrival DeleteMsg CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript smtpreg.vbs /setprop 1 OnArrival DeleteMsg Sink ScriptName "c:\Inetpub\AdminScripts\wss.vbs"
4. This will now catch all mail on arrival and remove the offending header.
So after hours of searching i finally found a "hack" to succesfully get Infopath form service mails to get picked up by the SPTimerService and saved in my incoming mail library.
Hope this helps someone out there!


Gr
Tom

Published: 5/5/2010  3:22 PM | 0  Comments | 0  Links to this post