Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Query Lotus Notes for number of Unread Mail in URL or Data Dump.

Posted on 2011-10-06
22
Medium Priority
?
737 Views
Last Modified: 2013-12-18
I need to display the number of unread emails a user has on a web page.

We have all see the Link for mail and then a (4) behind it meaning there are 4 unread emails in the account.

The email server is lotus. Is there a way i could provide the username and password from the user to a lotus database and get the number of unread emails back? Maybe in a url?

Another option would be to query lotus database every couple of minutes and dump the data into an sql database that i would then query with the web page. For instance, could i creat a table from lotus that lists the username along with the number of unread messages? If so i could make the web page query this table.
0
Comment
Question by:jennifer_merritt
  • 9
  • 7
  • 6
22 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36927782
Seems a rather crude approach to me: dump a database, create a table, etc. Did you know that a Domino server is a web server, so why all the indirect queries? Develop your web pages in Domino, I'd say. And why don't you use iNotes??

What Domino release is the server?
0
 

Author Comment

by:jennifer_merritt
ID: 36930522
I am running 8.5 domino.
I just need a page that will display one number...the number of unread emails. I just need to get this number and then i can complete the other page that i need to create.

The page shows a couple of application links with the number of actions that need to be taken....ie:

You have (4) unread emails.
You have (24) documents to sign.
You have (1) deficiency.

I would like to be able to pass a username and then get back the email number.
0
 

Author Comment

by:jennifer_merritt
ID: 36931737
I am using inotes actually. the link is to inotes. but i need to show them how many unread emails they have on the link...if that makes any sence?
 
The link to inotes is single sign on.
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 36932149
It sounds like you're making a dashboard.

Although there is no simple URL command that will return the unread count for a specific user, you can create a web service (or just a simple agent) that can return this info to your page using AJAX.

Here's an example of a simple agent that can be called via AJAX. Just remember that unread marks are stored per user, so the code that makes this AJAX call needs to be run as the logged in user.

Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim vc As NotesViewEntryCollection
Set db = session.CurrentDatabase
Set view = db.GetView("($Inbox)")
Set vc = view.GetAllUnreadEntries()
Print vc.Count

Open in new window

0
 

Author Comment

by:jennifer_merritt
ID: 36933002
is there a way that i could pass the username and be returned a number of unread mails? This has to happen on a web page. I could use an iframe.
I don't want to authenticate each user to get this one number.

Is there a way that i could use my crude way of getting this information? Can i get a dump from lotus showing a username and a number of unread emails. If i could get that dumped every couple of minutes, i would be able to query that table.

Does lotus domino provide a scheduled task that would allow it to be queried by a SQL server by chance?

I know it is not a nice idea, but it is the only solution i see that would not involve logging in a user in order to get one number(being the unread emails).
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 36933173
The only problem you have is that the user must be authenticated.  I know of no other workaround.  Once the user is authenticated, then retrieving the count is trivial.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36933952
Agreed, 100%. Some explanation: the unread count is per person, so if someone else would check my mail database he'd get a different number.
0
 

Author Comment

by:jennifer_merritt
ID: 36942042
Could i explore the possibility of outputting a table (in some format) that will show each users username and the number of unread emails?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36942107
AFAIK not possible.
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 36942412
Not possible unless you had all user names and password stored un-encrypted on the server.  Then you might be able to use HTTP POST to authenticate the user programatically and retrieve the count.  Of course, then you have the problem of storing, maintaining and securing a database that might present a security vulnerability.  Again, there's no way to get the count without authenticating the user.
0
 

Author Comment

by:jennifer_merritt
ID: 36942482
How would i go about authenticating the user and retrieving the number. I know how to authenticate via a http-post. But what would i do after authenticating in order to get the number back?
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 36942584
You would redirect to the agent or web service that returns the count.

The code is posted above (#36932149).  Place it in an agent that runs as the web user (security tab of agent properties).  If you use this agent as is, you will need to place it in each user's mail file.  Another option is to put the agent in a central location, and open the current user's email explicitly.
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 36942591
If it's single sign-on, the user is authenticated, so the number for the unread messages should be correct when their mail database is inspected.

AFAIK there is no call that produces the number you want. I suppose all you can do is something like this:
- create an Outline
- create one entry called ($Inbox)
- put that on a page
- execute an ajax-request to fetch that page, search for the number, and output the number
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36942597
Or he code above ... :$
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36943384
Eh? Does that work indeed??
0
 

Author Comment

by:jennifer_merritt
ID: 36943419
I haven't tried it, but have decided to reach out to a consultant to assist with this project. I hope to get a resolution that way.

Thank you for all your help.
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 36944393
RE:"Eh? Does that work indeed??"

Yep!  Anything printed in a web agent gets sent back to the browser.  This is how I provided web services in Domino before Lotus officially supported it.  I use this technique often to generate dynamic content for web apps at run time.  For the agent above, all you would need to do is check the value of responseText.  The only hard part about this question is the authentication.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36945036
Eh, Bill, that question was for Jennifer, regarding my suggestion to use an Outline in a Page. I was (and am still) rather surprised to be the sole beneficiary of the points awarded in this question, which seems not entirely fair to me.

@JM: maybe it's a suggestion to have the question reopened, and then we wait till you can publish the hired consultant's advice, so you can rightfully (re)award the points.
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 36948577
RE:"rather surprised"

Me too, but no worries.  As I've said many times, I don't do this for the points. In this case, the question is marked as answered with a 'Good' rating, but the answer is untested, still requires the user to authenticate, and will perform slower than my solution. Such is life.  ;)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36948901
No worries here, just amazed, and uncomfortable with the wrongly attributed credits (not points).
0
 

Author Comment

by:jennifer_merritt
ID: 36955576
I am not quite sure how to unclose a question. I wasn't expecting to have a discussion about points. Just thought some posts were more inline with what i wanted to do.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36955816
No problem, it is not really a points discussion. I was just wondering whether the best answer to your question was indeed the one you accepted, for Bill's code does a similar thing in a more modern and definitely shorter way. It's all up to you!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month21 days, 2 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question