Homepage.nsf: add link to users mail file

Can anyone explane to me: how to create a link to a users mail file on the homepage.nsf?This should work for every user… I mean, I can create a link to “mail\mailfile.nsf” but it should be different for every user)

If user1 accesses the webpage, the link should point to: mail\user1.nsf

If user2 accesses the webpage, the link should

point to: mail\user2.nsf

Subject: homepage.nsf: add link to users mail file

Create a Link Hotspot. Choose ‘Named Element’ as the type of item to link to. Choose ‘Frameset’ as the subtype. Click on the Browse button (the little folder one.) In the second drop-down box you can choose from a list of databases to get the frameset out of - one of the options is ‘-User’s Mailfile-’

I guess you can work it out from there :slight_smile:

Stephen Lister

Subject: RE: homepage.nsf: add link to users mail file

Thanks for your quick reply. I’ve tried the procedure that you described.

It seems to work within a Lotus Notes client, but when I try it from a web interface, then it just doesn’t work.

The hotspot isn’t a link anymore. Am I doing something wrong?

Subject: RE: homepage.nsf: add link to users mail file

Oops - my bad. I didn’t notice it was on the web.

A quick bit of research turned up the following advice…


Redirecting users to their mail files once they have connected to the server can be achieved through a form/document in the server’s homepage db. Create a link hotspot in the form with @Formulae to generate the URL - one possible set of @Formulae is as follows:

mailServer := @DbLookup (“”:“nocache”;“”:“names.nsf”;“($NamesFieldLookup)”;Username;“Mailserver”);
mailServerURL := @DbLookup (“”:“nocache”;“”:“names.nsf”;“($ServersLookup)”;mailServer;“HTTP_HostName”);
mailFile := @LowerCase(@DbLookup (“”:“nocache”;“”:“names.nsf”;“($NamesFieldLookup)”;UserName;“Mailfile”));
REM “The next line removes any carriage returns that have been accidentally entered in the MailFile field in the Person doc and adds .nsf if it is missing”;
mailFileURL := @Left(@Trim(@Explode(mailFile; @Char(13))) + “.”; “.”) + “.nsf”;
“http://” + mailServerURL + “/” + mailFileURL + “?opendatabase&login”;

This code assumes that you have already got the username and stored it in a field called Username. You should modify and test the code - my typing isn’t as good as it should be :slight_smile:


Hopefully this should help you get onto the right track :slight_smile:

Stephen Lister

Subject: RE: homepage.nsf: add link to users mail file

Thanks this works great.I’ve changed your code a little, I will post it. Maybe someone will find a use for it!

Anywayz, thanks for your help!

UserName := @V3UserName;

mailServer := @DbLookup (“”:“nocache”;“”:“names.nsf”;“($NamesFieldLookup)”;UserName;“Mailserver”);

mailServerURL := @DbLookup (“”:“nocache”;“”:“names.nsf”;“($ServersLookup)”;mailServer;“HTTP_HostName”);

mailFile := @LowerCase(@DbLookup (“”:“nocache”;“”:“names.nsf”;“($NamesFieldLookup)”;UserName;“Mailfile”));

REM {The next line removes any carriage returns that have been accidentally entered in the MailFile field in the Person doc and adds .nsf if it is missing};

mailFileURL := @Left(@Trim(@Explode(mailFile; @Char(13))) + “.”; “.”) + “.nsf”;

mailServerURL + “/” + mailFileURL + “?opendatabase&login”

Subject: RE: homepage.nsf: add link to users mail file

Hi Rob vd Velden,

thank you So much. I was Looking for simillar

functionality. It really helped

Thanks again

Raj

Subject: RE: homepage.nsf: add link to users mail file

It’s not my code - I just did a little searching for you and found it in the R5 forum. Glad it helped…

Stephen Lister

Subject: RE: homepage.nsf: add link to users mail file

Or WebMailredirect herehttp://www-10.lotus.com/ldd/sandbox.nsf/ByApplicationNameNJ/f4b19c0c3327df5385256a8f0063bdf4?OpenDocument

This will be shipped as part of Domino 6.5 (betas are in the code stream now)

G.

Subject: We use a little agent to get there

Hi Rob,we use an agent, that points to the mailfile even if not on the same server…

called OpenWebMail

Option Public

Option Declare

Sub Initialize

Dim doc As NotesDocument

Dim EnvDoc As NotesDocument

Dim db As NotesDatabase

Dim v As NotesView



Dim s As New NotesSession



On Error Goto Err_OWM



Set db = New NotesDatabase("","names.nsf")

Set EnvDoc = s.DocumentContext



If Not db.isOpen Then

	db.Open "",""

End If



Set v = db.Getview("($Users)")



Set doc = v.GetDocumentByKey(EnvDoc.Remote_User(0))

If doc Is Nothing Then

	Print "Your entry was not found in the Domino Directory, pls. check with the admins!"

Else

	Print "[https://"+pureServer(doc.MailServer(0))+"/"+puremailFile(doc.MailFile(0))+".nsf?OpenDatabase]"	

End If

Exit_OWM:

Exit Sub

Err_OWM:

Print Error$

Resume Exit_OWM

End Sub

Function pureServer(inString) As String

Dim nn As NotesName

Set nn = New NotesName(inString)

pureServer = nn.Common

End Function

Function puremailFile(inString) As String

Dim i As Integer

Dim outstring As String

Dim curChar As String



outstring=""

For i = 1 To Len(inString)

	curChar = Mid$(inString,i,1)

	If curChar="\" Then

		outstring = outstring+"/"

	Else

		outstring = outstring + curChar

	End If		

Next

puremailfile = outstring

End Function

Hope it helps