How to extract multiple XML attachments from a POP3 message

Home Page Forums BizTalk 2004 – BizTalk 2010 How to extract multiple XML attachments from a POP3 message

Viewing 1 reply thread
  • Author
    • #14528


      I am involved in a project where I need to extract several attachments from a mail message. I use the POP3 adapter to poll a mailbox and my test is done with 3 attachments. I use the technique to call a receive pipeline from an orchestration. I use the Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteReceivePipeline and then the MoveNext()method to get the first attachment. The Pipeline I use has a MIME/SMIME decoder with body content type set to text/xml and Body part Index set to 0

      My problem is that I only get one attachment but there is 3 in the message. After I got the first, MoveNext returns false.

      If I change the body part index in the pipeline to 2 then I get another of the attachments, but I can’t get moore than one out at rhe time. Does anyone know why?

      Johan Bouvin

    • #14529

      Even if I would have been happier if I was on the right track
      I will try to solve it with a custom component


      • #14530

        When you receive a POP3 message, you can specify the decode happens in the POP3 adapter or add a MIME/SMIME decoder to your receive pipeline.
        Either way you get one message with multiple parts. The pipeline will not split the parts into individual messages. Even calling a pipeline from the orchestration will not split the message parts into individual messages.

        If you have a fixed number of attachments then you can declared a multipart message with the same number of message parts in your orchestration and access the attachments as parts of the incoming message.

        If you have a variable number of message parts, then you will probably need some custom code.
        One possibility is a custom disassembler for splitting the message parts. This could be added to the receive pipeline from the POP3 adapter.
        The is an example disassembler for handling multipart message on GotDotNet. It does not exactly what you need but it could be modified

        • #14531

          I keep hearing and reading that the pop3 adapater (with MIME encoding se to true) will send each attachment to the MsgBoxDB as individual messages. When a process gets hung I think I see these from BTS Admin Console.

          I need to get all attachments (unknown quanity) depositted to a specific folder.

          Does anyone have a sample or example of how to strip the attachments from an email in BTS 2006?


Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.