Multi-Attachment processing with 7.02 is broken

We have been using the same Notes/Domino code to handle incoming mail and attachment processing for over 5 years. We have processed millions of emails and attachments using the piece of code below.

Recently we upgraded a few servers to 7.02 and it broke.

Forall item In doc.Items

If (item.Type = ATTACHMENT) Then

Set oFile = doc.GetAttachment(item.Values(0))

If Not (oFile Is Nothing) Then

  oFile.ExtractFile sPath & oFile.Name

  detachedcount = detachedcount + 1

  detachednames = detachednames +", " + Cstr(oFile.Name)

End If

End If

End Forall

The problem in the code is 7.02 only processes/detaches 1 attachment. Previously it processed all atts. It was several days before an analyst noticed and we lost a lot of business.

We contacted IBM and they can NOT explain why it broke…yet! The nice IBM appdev team in Texas provided a code change that solved the problem with a workaround. I thank them but need the code to work. They entered an SPR and customer report: Customer report LO16361 against SPR # UKUR6T7H8S. Also I created a new SPR # RDJS78ATAJ

Our problem is we have over 80 servers servicing our 50+ companies. We can’t go changing code all over the place that SHOULD work.

My question: IS ANYONE ELSE HAVING THIS PROBLEM AFTER UPGRADING? Problem is you may not have noticed as it doesn’t generate an error.

Here is the IBM workaround which requires recoding:

Set rtitem = doc.GetFirstItem( “Body” )

If ( rtitem.Type = RICHTEXT ) Then

Print “IBM Code”

If (Isempty(rtitem.EmbeddedObjects) = 0) Then

Forall o In rtitem.EmbeddedObjects

If ( o.Type = EMBED_ATTACHMENT ) Then

o.ExtractFile sPath & o.Name

detachedcount = detachedcount + 1

detachednames = detachednames +", " + Cstr(o.Name)

End If

End Forall

End If

End If

Your deatiled experience with this is appreciated.

Subject: Multi-Attachment processing with 7.02 is broken

Have come across what looks like the same bug in 8.5.2.

In my case i was asked to write an agent that removed files called smime.p7s from incoming emails (electronic orders with .txt attachments).

I was also using the Forall item In doc.Items

If (item.Type = ATTACHMENT) Then… to loop through the attachments.

I found that it worked as expected on internal emails but didnt work properly on external email.

Further investigation found the bizarre situation which i could reproduce 100% of the time where if you had 2 attachments aaaaa850.txt and smime.p7s (in that order) then the forall item would process the txt file twice and ignore the p7s.

But if the files were attached in the other sequence, p7s first, then both attachments were processed succesfully by forall items.

Anyway, i implemented the rtitems.EmbeddedObjects workaround and that works…