Csv attachment problem - inline rendering

a linux server sends a mail to a domino-mail-database (not a personal mail-db of a user). The body-item of the mail contains six attachments file1.xyz, file2.abc, file3.rtz and so on./One/ attachment is always a csv-file: file6.csv

All attachments are perfectly visible in the mail-document in the Domino-Mail-DB.

Now a “triggers after new mail arrives” agent comes to life, sees the new mail, grabs it, creates a /new/ NotesDocument, copies the body-item of the mail via notesDocument.copyItem to the new document and finally saves the new document to /another/ database which is based on the Standard-DocLib-Template(Notes/Web) v8.5.2.

And there the csv-attachment is no longer visible as attachment - but as inline text. The attachment-name ist also completely gone.

This database is for customers, they need to see the csv-file!

The original mail contains six $FILE-items, the new document with the copied body-item only five $FILE-items.

What’s the starting point to resolve this? Since no NotesClient is involved in the whole process it must have something to do with the domino server.

If another filextension than *csv ist used, i.e. *.csa the attachment works perfectly!

Any help is much appreciated.

Here’s the essential code from the agent that creates the new doc from the original mail:

Set docTarget = New NotesDocument(dbTarget)

docTarget.Form = “Document”

docTarget.Subject = “subject”

Set item = docMail.GetFirstItem(“Body”)

Call docTarget.CopyItem(item, “Body” )

Call docTarget.Save(True,True)

Subject: Try this instead

Tom,

I must admit, I don’t know why the csv kind of disapear, but for richtext handling, I almost never use copyItem as I have seen some strange behaviours.

To copy a richtext, I always create a new richtext in the target document and append the richtext from the source document.

So try this.

Set docTarget = New NotesDocument(dbTarget)

docTarget.Form = “Document”

docTarget.Subject = “subject”

Set item = docMail.GetFirstItem(“Body”)

dim targetBody as New NotesRichTextItem(docTarget,“Body”)

call targetBody.AppendRTItem(item)

Call docTarget.Save(True,True)

Hope this helps

Renaud

Subject: did that

Thanks Renaud, did that immidiately - without any luck. Exactly the same rendering as before.

Subject: the solution finally…

…was to copy the complete maildoc into the other database via:

docMail.CopyToDatabase(targetDB)

with that way the csv-attachment survives :slight_smile:

still no clue why not with the other ways.