"Failed to decodethe S/MIME message. The S/MIME message may not be valid." when using POPadapter to process incoming emails in BizTalk server 2009
Considering thefollowing scenario:
You are using the POP3 adapter to process incoming e-mailsin BizTalk server 2009, and there is a sporadic failure with certain e-mailmessages. These failures result in suspended resumable messages with thefollowing error information:
A message received by adapter"POP3" on receive location "POP3ReceiveLocation" with URI xxxis suspended.
Error details: There was anauthentication failure. "Failed to decode the S/MIME message. The S/MIMEmessage may not be valid.".
You have already found the KB article 982634: http://support.microsoft.com/kb/982634/en-us, but it does not apply to you, as you had BizTalk server 2009 CU2 deployedalready. The symptoms are the same however.
When we took a BizTalk trace to investigate into this issue,below information could be observed:
[CSharp]:MIME_SMIME_Decoder.Execute2:failed could not find mimeversion header.
[CSharp]:MIME_SMIME_Decoder.Executecaught MIME exception failed Message:Exception of type'Microsoft.BizTalk.Component.MIMEException' was thrown.
We noticed that it was not detecting the version of MIME.Further investigation revealed that a registry key was being read to determinethe amount of data to be read before the MIME version was determined and thatdefaults to 4kb. This was done for performance reasons.
To resolve this issue, please do the following:
Add the following registry key with the following value [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTSSvc.3.0]
Hex19000/Dec102400 isthe maximum value for this registry value.
In BizTalk versions before 2010, only the first 4KB of themessage MIME headers are scanned to get the MIME version. Thus, messages withexcessively long headers will not get decoded.