An alternative to using the POP3 adapter to read email attachments – 2

Posted: December 30, 2008  |  Categories: BizTalk Uncategorized
Tags: BizTalk POP3

Why would you use anything else other than the POP3 adapter to consume email attachments in BizTalk? On Christmas eve I found a reason why you might want to use something else.

I was trying to finish a project where we receive un-typed documents as attachments via email and then do further processing on them. We used the a POP3 adapter to consume the emails. I tried one test to many. I attached the same attachment with the same file name to the email more than once. The POP3 adapter then fails abruptly on the receive port with something like;

“A message received by adapter “POP3” on receive location “Receive
UBF POP3” with
URI “POP3://EXCH.hooleydooleys.co.nz#KeyTest” is suspended.
Error details: Item has already been added. Key in dictionary: ‘Copy
of Bakery Instore Processed with 1month.xls’ Key being added: ‘Copy
of Bakery Instore Processed with 1month.xls’ ”

What is even worse it is not picked up by error routing on the port.
The error seems to suggest to me that the POP3 adapter does work with if multiple attachments have the same name.

The hour was getting late and I wanted to leave. I discovered that if you save the email to file as an eml file and then consume it with a file adapter using the MIME/SMIME decoder in a pipeline you can consume attachments with the same filename from an email. Thus the problem seems to be with the POP3 adapter.

I set up a SMTP server on the BizTalk server as described in a previous post, An alternative to using the POP3 adapter to read email attachments.

I created a custom decode pipeline to get the POP3.To, POP3.From and POP3.subject properties because the standard MIME/SMIME decoder does not capture the To: , From: or Subject: fields from an eml file. The custom decode receive pipeline component inherits from the MIME/SMIME decoder and also promotes values for POP3.To, POP3.From and POP3.Subject on the message. This did not take long because Kenny West has already described in detail how to do it (See  kennywest: Mime Decoder Pipeline Component in Biztalk 2004 (the solution)). Thanks Kenny I owe you one.

I added the new custom decode pipeline component to a new custom receive pipeline and configured it like so.

emldecoder2

Finally I created a file receive location that used the custom receive pipeline and used it to consume the eml files. I was happy I could finally go home for Christmas!

I’ll ask Microsoft whether they have a fix for this POP3 issue in the New Year but I was pleased that this workaround got me there in the end.

turbo360

Back to Top