Tip

Get handle to Usersmailfile in browser including correct TCPaddress of home mailserver

When you want the user to be able to link to his own mailfile from a web application database on any server. We need to know the mailfile location and the server dns/wins name or IP address. This piece of formula retrieve the information and builds it to a basic http link which you can used to build your anchor and/or extend it with a viewopen or anything you like.


REM "GET USER MAILFILE LOCATION";
NAB:="names.nsf";
MailFile:=@DbLookup( "" : "NoCache" ; "" :NAB ;"($Users)" ; @Username ;"MailFile" );
REM "GET HOMEMAIL SERVER";
MailServer:=@DbLookup( "" : "NoCache" ; "" :NAB ;"($Users)" ; @Username ;"MailServer" );
REM "GET IP ADDRESS OR DNS ENTRY OF SERVER";
ENABLED:=@DbLookup( "" : "NoCache" ; "" :NAB ;"($Servers)" ;MailServer ;"EnabledList" );
REM "DETERMINE ENABLED TCP PORT";
USE:=@If(@Subset(ENABLED;1)="1" & @DbLookup( "" : "NoCache" ; "" :NAB ;"($Servers)" ;MailServer ;"Protocol_0" )="TCP";"0";@Subset(ENABLED;2)="1" & @DbLookup( "" : "NoCache" ; "" :NAB ;"($Servers)" ;MailServer ;"Protocol_1" )="TCP";"1";@Subset(ENABLED;3)="1" & @DbLookup( "" : "NoCache" ; "" :NAB ;"($Servers)" ;MailServer ;"Protocol_2" )="TCP";"2";@Subset(ENABLED;4)="1" & @DbLookup( "" : "NoCache" ; "" :NAB ;"($Servers)" ;MailServer ;"Protocol_3" )="TCP";"3";@Subset(ENABLED;5)="1" & @DbLookup( "" : "NoCache" ; "" :NAB ;"($Servers)" ;MailServer ;"Protocol_4" )="TCP";"4";@Subset(ENABLED;6)="1" & @DbLookup( "" : "NoCache" ; "" :NAB ;"($Servers)" ;MailServer ;"Protocol_5" )="TCP";"5";@Subset(ENABLED;7)="1" & @DbLookup( "" : "NoCache" ; "" :NAB ;"($Servers)" ;MailServer ;"Protocol_6" )="TCP";"6";@Subset(ENABLED;8)="1" & @DbLookup( "" : "NoCache" ; "" :NAB ;"($Servers)" ;MailServer ;"Protocol_7" )="TCP";"7";"");
NETADDRESS:=@DbLookup( "" : "NoCache" ; "" :"names.nsf" ;"($Servers)" ;MailServer ;@Trim("NetAddr_"+@Trim(USE)) );
REM "BUILD HTTP ADDRESS OF MAILFILE";
"http://"+NETADDRESS+"/"+@If(@Right(MailFile;4)=".nsf";MailFile;MailFile+".nsf");

This was first published in July 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.