views:

176

answers:

3

Has anybody some information about accessing Lotus Domino server to fetch entire mail contents by http(s) requests from php linux server?

The article by Andrei Kouvchinnikov describes well how to fetch message list in notes mail folders; after obtaining session id during login one can for example select top 100 messages by calling:

https://your.server.domain/mail_db/mailbox.nsf/($Inbox)?ReadViewEntries&Start=1&Count=100

And this works perfectly. The problem arises when I am trying to get message contents (0A1DA5EEB7B65277C12576F50055D811 is an example message unique Id):

https://your.server.domain/mail_db/mailbox.nsf/($Inbox)/0A1DA5EEB7B65277C12576F50055D811/?OpenDocument

Such request in IE shows frameset with data hard to parse, in less common browsers like Opera it informs about unsupported browser. Ideally if it is possible to fetch notes message contents and all attachments by requesting it in the url, has anybody some information what request would it be? Link to Lotus web calls reference would be even more beneficial.

+1  A: 

Here is the list of Domino URL Commands: http://www.ibm.com/developerworks/lotus/library/ls-Domino_URL_cheat_sheet/

You can get the inbox data back as a URL using the ReadViewEntries command. Unfortunately there isn't a built in one for reading documents as XML.

One tip is to create a copy of the Mail form in the Notes mail database (or template used by all mail databases), and set it up to output XML for all the mail fields. You would then need to set the form as Web-only, and rename or hide any others with the same name that are set to appear on the Web. Then Notes would use your form to build responses to Web clients. Note, you'll also have to make some changes to the template to disable the framesets from being used for Web clients. Unfortunately, these changes could break the use of Domino Web Access, if you use that system for accessing email via the Web.

Ken Pespisa
+1  A: 

eMail messages don't come in XML format. They are either MIME or RichText. So when you want them as XML you need something to convert it for you first. The ?ReadViewEntries XML would give you already some essential data (from, time, subject) and you could use

https://your.server.domain/mail_db/mailbox.nsf/($Inbox)/0A1DA5EEB7B65277C12576F50055D811/Body?OpenField

to get the HTML representation of the Mail body. Other than that I would deploy a small agent to the Domino server that renders the messages in the format you need. For mime messages you probably want the original MIME format and for RichText the MIME conversion of it.

stwissel
A: 

The definitive answer to this problem is undocumented in Lotus URL specification, so I will share it here. To fetch whole message with headers and attachments only Lotus message UID is required, the URL is:

https://your.server.domain/mail_db/mailbox.nsf/($Inbox)/ca59f0649511e091c12576ce005af21d/?OpenDocument&Form=l_MailMessageHeader&PresetFields=FullMessage;1

where ca59f0649511e091c12576ce005af21d is example message UID. I hope somebody will find this information useful.

too