Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

PreviousPrevious NextNext


Pascal Quesseveur 23.Aug.11 12:57 PM a Web browser
Toolkits 6.5.4 All Platforms


I am trying to develop an extension for Notes 6.5 (that version is mandatory and I can't change it). That extension has to do the following:

- on sending mails: catch the attachments and the mail text, encrypt them in one file using specific algorithm, replace the existing mail with the encrypted file.

- on reading mails: decrypt the encrypted file, replace the mail content with the parts and attachments contained in the encrypted file.

I have choosen to develop that extension using the C API and I have followed the extmail sample (perhaps it would have been easier using LotusScript but I had absolutely no idea on how to do it). At present I am able to send mails but I have the following problems:

- When I call NFSNoteUpdate to validate message modifications, the extension handler is called a second time with mode EM_REG_BEFORE. I haven't read anything about this in the doc and I wonder if there is something wrong in my code.

- I thought the hardest task would have been sending the emails, but I found I am unable to read the received mails in my extension. I have tried to set a handler on EM_NSFNOTEOPEN but I always get a Notes panic crash due to an invalid handle. I have tried differents things without any success. I get the same error with extmngr sample. Other samples which manipulate notes through a database handle (as rsimple) work fine.

Basically my code is as follows:

=========================================================================
STATUS LNPUBLIC DLL_EXPORT EMHandlerNoteProc (EMRECORD FAR * pExRecord);

STATUS RegisterEntry()
{
STATUS error = EMRegister(EM_NSFNOTEOPEN, EM_REG_AFTERBEFORE,
(EMHANDLER)gHandlerNoteProc,
gRecursionID, &hHandlerNote);
return(error);
}
STATUS LNPUBLIC EMHandlerNoteProc (EMRECORD FAR * pex_record)
{
STATUS sError = NOERROR;
switch (pex_record->EId)
{
case EM_NSFNOTEOPEN:
VARARG_PTR ap = pex_record->Ap;
HANDLE h_note = VARARG_GET (ap, HANDLE);
if (pex_record->Status != NOERROR)
break;
if (pex_record->NotificationType == EM_BEFORE)
{
NOTEID nid;
// NSFNoteGetInfo (h_note, _NOTE_ID, &nid);
}
break;
}
return (ERR_EM_CONTINUE);
}
BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD fdwReason, LPVOID lpReserved)
{
STATUS error = NOERROR;
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
InitializeCriticalSection (&gCriticalSection);
gHandlerNoteProc =
(EMHANDLER)MakeProcInstance ((FARPROC)EMHandlerNoteProc, hInstance);
break;
case DLL_PROCESS_DETACH:
CleanUp ();
FreeProcInstance (gHandlerNoteProc);
error = DeregisterEntry ();
DeleteCriticalSection (&gCriticalSection);
break;
}
return( TRUE );
UNREFERENCED_PARAMETER(lpReserved);
}
=========================================================================

I get a crash when I uncomment the line

// NSFNoteGetInfo (h_note, _NOTE_ID, &nid);

For my tests I use Notes 6.5.4 (March 27, 2005) and I send/get emails to a SMTP/IMAP server. I don't use any Domino server. I haven't been able to find the Notes API for 6.5 so I have installed the version 5.0.6 upgraded to 5.0.11.

I would be very pleased if someone could show me the way to read the mails, or give a pointer to some documentation or sample.








  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite