I'm working on an email extension for domino (libXXX.so and nXXX.dll plugin) that uses the "Lotus C API Notes/Domino 6.5" (http://www-12.lotus.com/ldd/doc/tools/c/6.5/api65ref.nsf
) to mess with incoming emails (individual nsf objects - using strange functions like OSLockObject() and NSFDbReallocObject() ).
Sometimes I want to quarantine attachments, replacing the attachment with a text file (a short quarantine notice).
I can do this in (at least) 2 ways:
1) remove the attachment, and add a new one.
2) replace the attachment with the text from my text file, and modify the mime info
The problem with using 1) is that the old entry is removed, so when I search for the next attachment (using NSFItemInfoNext(), the entry point is not found and ERR_ITEM_NOT_FOUND is returned - meaning that none of the remaining attachments are found).
The problem with using 2) is that I have to change the mime info and the reallocate the FILEOBJECT stuff (different length name and stuff like that). That seems to be almost impossible*.
*) Just about every memory related function in the API has a warning similar to "Calling this routine with a HANDLE that is invalid or out of range will result in a Notes PANIC halt" (a BAD server crash), so this is like programming a mine field...