0
votes

I recently wrote a Windows Service that used Exchange Web Services to listen to a particular mailbox and then when that mailbox received a new message the application send an email to a completely different set of users. I did this through a subscription service so that in could be ran constantly.

I want to recreate this application except for integrating it with Lotus Domino/Notes. I have done some research and am aware of the Lotus C API (maybe) as well as Lotus Domino Designer (which doesn't seem like what I want) and LotusScript (maybe).

My Questions:

  1. Is this even possible with Lotus Domino/Notes
  2. Which, if any, of the above should I research more on? If none, what am I better of using?

Thanks

EDIT:

I forgot to add that upon receiving the message the application also parses the received email to extract the body and recipients and sends a POST message to a separate server that is running a REST service.

The above functionality is why I didn't merely set up a rule in Exchange the first time

4
Could you expand on how your service gets notified on new mail? Do you poll the exchange mailbox via webservices?leyrer

4 Answers

3
votes

listen to a particular mailbox and then when that mailbox received a new message the application send an email to a completely different set of users.

A number of ways to do this.

1. Mail rules in the mail file.

http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.notes.help.doc/DOC/H_USING_RULES_TO_FILTER_NEW_MESSAGES_STEPS.html

2. Create an agent in the mail file that reacts "When new mail arrives" and code it (Java / LotusScript / SimpleAgent).

http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.designer.domino.main.doc/H_WRITING_SCRIPTS_AND_FORMULAS_FOR_AGENTS.html

3. Server mail rules (which I haven't played with, better to ask on ServerAdmin).

http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.help.domino.admin.doc/DOC/H_FILTERING_OUT_UNWANTED_EMAIL_OVER.html

Seems a bit silly having a separate application to monitor the mailbox, unless that application is required to do something else outside of Domino.

2
votes

You can consume web services and issue POST requests (LotusScript/Windows or Java) with LotusScript or Java agents in Domino.

EDIT:

I'm assuming you want/need to leave the mailbox in Exchange. If that's not the case, use any of the other suggestions, they're all good. But if it does need to stay in Exchange, an agent (whether LotusScript or Java) is easier to create and maintain than the C API.

1
votes

It would be easiest if the mail file were in Notes/Domino itself. If it were, you'd simply set up an agent that would run when new mail is received in that mail file that generates the message to the other users. Doing it in a solely Notes environment would be child's play.

0
votes

Based on the Q&A going on for other answers, I believe you need to be using the Notes C API. In particular, you should be using the Extension Manager feature of the API. I'm basing this partly on your use of the word "intercept" in one of the answers. To truly do that, what you need to do is hook events in the Domino server's router mailbox files. But actually, there are two reasons for this:

  • That's what most compliance and security products tend to do in order to intercept messages before they are delivered.

  • There are always going to be fewer router mailbox files to hook than there are user mail files. So even if you don't have the technical requirement of catching the message before delivery, it's still a better idea to centralize rather than distribute the work across lots of agents in lots of user mailboxes, or to be hooking delivery yourself in lots of user mailboxes.

The usual technique for something like this involves a small-footprint DLL that hooks events and places messages into an "On Hold" state, and then signals another piece of code that is running as server task. That way the router won't try to process delivery of the message until you're code does everything it needs to do (which might take a few cycles if you have to wait for response when you are posting to your REST service). The server task is also written using the C API. (Java is also a potential option for server tasks. IBM has server tasks that are written in Java, but I've always gotten blank stares from IBMers when I've asked point-blank whether the interfaces for this are documented and supported for 3rd party use!) This server task code can inspect the message to see if it is being delivered to one of the users you need to be tracking, quickly release the hold if not, and then do whatever else it needs to do and then finally take it off hold.

Now, here's another thought. You already have a Windows service that uses Exchange Web Services, and it has all the logic in it that you really want. Why duplicate that logic? Domino supports deployment of your own web services, so perhaps the right way to do this is to use the extension manager to put the messages "on hold", but instead of a server task doing the processing you would create a Domino web service to pass the data back to your Windows services, closely mimicking the interfaces that you are already using to talk to Exchange. I'm not familiar with Exchange Web Services, and I don't know how you use it to have your Windows service be "listening", so I'm not certain whether this is really do-able with Domino's concept of web services. Maybe you might have to be "polling" rather than listening. Anyhow, it's just a thought.