ND8 – Using SMTP Outbound Authentication To Relay Hosts

One of the new features in the brand new release 8 of IBM’s Lotus Notes an Domino is the SMTP outbound authentication (SMTP AUTH) to relay hosts. Most of the ISPs only allow authenticated users / server to relay mail thru their server.
To setup this new feature follow these simple steps:

  • 1. Make sure you already have a Configuration Settings document for the server(s) to be configured.
  • 2. From the Domino Administrator, click the Configuration tab and expand the Messaging section.
  • 3. Click Configurations.
  • 4. Select the Configuration Settings document for the mail server or servers you want to administer, and click Edit Configuration.
  • 5. Click the Router/SMTP – Basics tab.
  • 6. In the field “Use authentication when sending messages to the relay host,” choose one of these:
    • Required – Checks whether the server can authenticate. If the server cannot authenticate, no attempt is made to try a non-authenticated session.
    • Enabled – Checks whether the server can authenticate. If the server cannot authenticate, an attempt is made to try a non-authenticated session.
    • Disabled – The SMTP Authentication feature is disabled. Authentication is not attempted.
  • 7. Specify the SMTP account name in the Name field, and the SMTP password in the Password field.
  • 8. Type the host name into the field “Relay host for messages leaving the local internet domain”.
  • 9.Click Save and Close.

I’ve only tested with freenet.de. maybe there are problems with other ISPs as in the past with 1&1.

SMTP Outbout Authentication

I would like to say thank you to Ramon Bisswanger who invented and developed the SMTP AUTH tool. I’ve used his great tool to send mail via my Domino server without any problems for the past 3 years.


Sametime 7.5.1 For Notes And Domino 8.0.x

Downloaded the IBM Lotus Sametime Server 7.5.1 Instant Messaging Limited Use for Windows Multilingual (C133DML) from Passport Advantage and started to install it on my Domino 8 server.
Then, after a short while:

Please, IBM, could you fix the download. I don’t think that I’ve downloaded the wrong package …


Access Field Names Preceded By ‘$’ With LS

You have LotusScript code that runs against a particular document. The document contains several fields that have names preceded by a $ symbol. When you attempt to reference these fields in the code via extended-class syntax, an error occurs. Is it possible to access these fields in LotusScript using extended-class syntax?

To access these fields in LotusScript using extended-class syntax, you must insert a tilde character (~) immediately before the $ sign.

For example, while the following line generates an error:

variablename = doc.$AdditionalHeaders(0)

The modified line runs as intended:

variablename = doc.~$AdditionalHeaders(0)

[via Lotus Notes KnowledgeBase #1098756]


Taking Notes Podcast Episode 64

After a long period of silence ( a month or so 🙂 ) Bruce Elgort and Julian Robichaux produced a new episode of the Taking Notes podcast.

Episode 64 covers everything about Lotus Connections 1.0, Quickr 8.0, Lotusphere 2008. It contains a UKLUG update with Warren Elsmore, Collaboration University, Sametime 7.5.1 CF1, The LotusViralMarketing blog and, an “Interface Matters” segment from Chris Blatnick.

So download episode 64 right now from here.


Coming Soon – IdeaExchange

IdeaExchange

This site will not only allow the community to drive future features that they would like to see in Notes/Domino/Samtime/Quickr etc. but will also be for Lotus ISV’s as well. I have discussed this concept with a half dozen or so Lotus ISV’s in they welcome the approach that we are striving to deliver.

Bruce Elgort

[more …]


Gantt Charts in Notes Views – The Sequel

Several gurus of the Lotus Notes community ( like Chris Blatnick, Nathan Freeman, Theo Heselmans, Vitor Pereira, and to round it out Kevin Pettitt ) are working on Gantt Charts in Notes Views these days. Nathan Freeman also provided a sample database.

I’ve downloaded the sample and gave it a try. The first thing I found out is that it is not possible to display more than one month in a view because the “zeroDate” – value for the columns is calculated by stripping the last part of the view title and convert it into a DateTime value. The sideeffect of this method is that documents from a different month are displayed in the view but no chart is displayed for these documents.
OK, you can avoid this by setting the view selction formula properly. The second thing is that Nathan uses

zeroDate :=@TextToTime(@Right(@ViewTitle; "-"));

in each of the 62 view columns to calculate the date basis. Maybe a bit ressource performance consuming, isn’t it ?

So I decided to make a few modifications to address these issues. I created a new field in the task form ( “zeroDate”, Date/Time, calculated )

Gantt Charts in Notes Views
and assigned the following formula to the field:

@TextToTime("[01/"+ @Text(@Month(startDate)) +"/"+ @Text(@Year(startDate)) + "]" )

When you create a new task, the zeroDate field is now set to the first day of the month according to the start date’s month.

You can now delete the unnecessary code from the column formulas and reduce it to

col := 0;
colDate := @Adjust(zeroDate; 0; 0; col; 0; 0; 0);
@If(@Date(startDate) = @Date(coldate); duration; " ")

After adding two categorized columns ( one contains @Year(StartDate) and the other one @Month(StartDate) ) the view displays the charts for each month in a seperate category.

Gantt Charts in Notes Views
The view can have any name of your choice.


ReportGenerator Class

Andre Guirard presents a class for creating rich-text reports and displaying them in a few different ways. It includes code to deal with the problem of paragraphs getting too long, and conversely, the problem of having too many paragraphs.

Basically, when you want to have a line break in your report, the class only starts a new paragraph if you specify it has to. Otherwise it uses line break, unless the paragraph is getting too long, in which case it starts a new paragraph.


Calculate Elapsed Time Between Two Date/Time Values

For my OpenNTF project !!HELP!! I needed a function to calculate the elapsed time between two events. The code should be able to exclude holidays and weekends. In addition it should calculate the time difference only within workhours. Here is the result of a rainy sunday 🙂
There is another class by Sean Burgess, which does the same stuff than mine.

The following sample returns the amount of time in minutes between two given date/time values

Sub Click(Source As Button)
	Dim startdt As String
	Dim enddt As String
	Dim dtc As New DateTimeCalculator ( "1,7","24.12.2007","7:00~17:00")

	startdt = "18.06.2007 16:59"
	enddt = "19.06.2007 07:01"

	Msgbox dtc.GetElapsedTime(startdt,enddt)
End Sub

Copy the following code to a script library. Type

Use "YourLibName"

into the Options section of your button, agent or whereever you like to use the lib. Don’t forget to include Julian Robichaux’s OpenLog for error trapping.

Class DateTimeCalculator

	Private StartDT As NotesDateTime
	Private EndDT As NotesDateTime
	Private dt3 As NotesDateTime
	Private dt4 As NotesDateTime
	Private dt5 As NotesDateTime
	Private WDENDHOUR As String
	Private WDSTARTHOUR As String
	Private nondays As String
	Private holidays As String

	Sub New (strExcludeDays As String,strExcludeDates As String,SERVICEHOURS As String)
		On Error Goto ERRHANDLE

		WDSTARTHOUR = "00:00"
		WDENDHOUR = "23:59"
		nondays = "0"
		holidays = "[01/01/1899]"

		If SERVICEHOURS <> "" Then
			WDSTARTHOUR = Strtoken(SERVICEHOURS,"~",1)
			WDENDHOUR = Strtoken(SERVICEHOURS,"~",2)
		End If
		If strExcludeDays <> "" Then
			nondays = Implode(Split(strExcludeDays,","),":")
		End If
		If strExcludeDates <> "" Then
			holidays = Implode(Split(strExcludeDates,","),"]:[")
			holidays = "[" & holidays & "]"
		End If

EXITPOINT:
		Exit Sub
ERRHANDLE:
		Call LogError()
		Resume EXITPOINT
	End Sub

	Public Function GetNextBusinessDay (dt1 As String) As String
		On Error Goto ERRHANDLE
		Dim newDT As Boolean
		Set Me.StartDT = New NotesDateTime(dt1)
		NewDt = False
		Set dt3 = New NotesDateTime(Me.StartDT.DateOnly & " " & Me.WDSTARTHOUR)
		Set dt4 = New NotesDateTime(Me.StartDT.DateOnly & " " & Me.WDENDHOUR)
		If Me.StartDT.TimeDifference(dt3) < 0 Then ' StartDT < WDSTARTHOUR
			Set Me.StartDT = dt3
		End If

		If dt4.TimeDifference(Me.StartDT) < 0 Then ' StartDT > WDENDHOUR
			Set Me.StartDT = dt3
			Call Me.StartDT.AdjustDay(1)
		End If

		While Me.GetBusinessDays (StartDT.DateOnly,StartDT.DateOnly ) = 0
			Call StartDT.AdjustDay(1)
			NewDT = True
		Wend

		If NewDT Then
			Set dt5 = New NotesDateTime(Me.StartDT.DateOnly & " " & Me.WDSTARTHOUR)
			Set Me.StartDT = dt5
		End If

		GetNextBusinessDay = Me.StartDT.LocalTime

EXITPOINT:
		Exit Function
ERRHANDLE:
		Call LogError()
		Resume EXITPOINT
	End Function

	Private Function GetNumBusinessDayHours () As Integer
		On Error Goto ERRHANDLE
		Dim BDHOURS1 As New NotesDateTime(Today & " " & Me.WDSTARTHOUR)
		Dim BDHOURS2 As New NotesDateTime(Today & " " & Me.WDENDHOUR)
		GetNumBusinessDayHours = Fix(((BDHOURS2.TimeDifference(BDHOURS1)/60)Mod 1440)/60)

EXITPOINT:
		Exit Function
ERRHANDLE:
		Call LogError()
		Resume EXITPOINT
	End Function

	Private Function GetTimeDifference (strStart As String,strEnd As String ) As Long
		On Error Goto ERRHANDLE
		Dim BDSTART As New NotesDateTime(strStart)
		Dim BDEND As New NotesDateTime(strEnd)
		GetTimeDifference = Fix((BDEND.TimeDifference(BDSTART)/60)Mod 1440)

EXITPOINT:
		Exit Function
ERRHANDLE:
		Call LogError()
		Resume EXITPOINT
	End Function

	Public Function GetBusinessDays(dtStart As String,dtEnd As String) As Integer
		On Error Goto ERRHANDLE
		Dim busdays As Variant

		Dim BDS As New NotesDateTime(dtStart)
		Dim BDE As New NotesDateTime(dtEnd)

		busdays = Evaluate(_
		{@BusinessDays([}&_
		Cdat(BDS.DateOnly)& {];[}&_
		Cdat(BDE.DateOnly)& {];}&_
		Me.nondays &{;}&_
		Me.holidays & {)})
		GetBusinessDays = Cint(busdays(0))

EXITPOINT:
		Exit Function
ERRHANDLE:
		Call LogError()
		Resume EXITPOINT
	End Function

	Public Function GetElapsedTime (dtStart As String,dtEnd As String) As Long
		On Error Goto ERRHANDLE
		Dim intStart As Long
		Dim intMiddle As Long
		Dim intEnd As Long
		Dim i As Integer

		Set dt3 = New NotesDateTime(dtStart)
		Set dt4 = New NotesDateTime(dtEnd)
		If dt3.DateOnly = dt4.dateonly Then ' same day
			GetElapsedTime = Me.GetTimeDifference(dtStart,dtEnd)
		Else
			intStart = Me.GetTimeDifference(dtStart,Cstr(dt3.DateOnly & " " & Me.WDENDHOUR))
			intMiddle = 0
			i = Me.GetBusinessDays(dtStart,dtEnd)-2
			If i > 0 Then
				intMiddle = (i*Me.GetNumBusinessDayHours())*60
			End If
			intEnd = Me.GetTimeDifference(Cstr(dt4.DateOnly & " " & Me.WDSTARTHOUR),dtEnd)
			GetElapsedTime = intStart+intMiddle+intEnd
		End If

EXITPOINT:
		Exit Function
ERRHANDLE:
		Call LogError()
		Resume EXITPOINT
	End Function
End Class

Adjust Date/Time To Next Business Day – Part II

In my recent posting I showed a method to calculate the number of business days between one date and another. It is possible to exclude weekends and a list of dates, too.
How to adjust Date/Time to next business day, I’ve already described here.

When using the GetBusinessDays method from my recent posting, the code to adjust a date to the next business day can be reduced to at least this snippet:

Sub Click(Source As Button)
	Dim dtStart As String
	Dim dtEnd As String
	dtStart = Today
	dtEnd = dtStart

	Dim b As New BusinessDay("1:7","[18.06.2007]:[19.06.2007]:[20.06.2007]")
	Dim StartDT As NotesDateTime

	Set StartDT = New NotesDateTime (dtStart)
	While b.GetBusinessDays (dtStart,dtEnd ) = 0
		Call StartDT.AdjustDay(1)
		dtEnd = StartDT.DateOnly
	Wend

	Msgbox StartDT.DateOnly
End Sub

This is a great example of how evaluating @formulas in LotusScript can save you a lot of time when you want to write a function which is not available in Script.


@BusinessDays In LS

In R6 you can use @BusinessDays to calculate the number of working days between one date and another, excluding non-working days and a list of dates to exclude as well. As there is no equivalent in LotusScript, I wrote a small class to simulate @BusinessDays in LS.
Actually I did not reinvent the wheel, but simply used evaluate in combination with @BusinessDays to achieve the aim.

Here is my code:

Class BusinessDay

	Private holidays As String
	Private nondays As String

	Sub New (strExcludeDays As String,strExcludeDates As String)
		holidays = "[01/01/1899]"
		nondays = "0"
		If strExcludeDays <> "" Then
			nondays = strExcludeDays
		End If

		If strExcludeDates <> "" Then
			holidays = strExcludeDates
		End If
	End Sub

	Public Function GetBusinessDays(dtStart As String,dtEnd As String) As Integer

		Dim bd As Variant
		Dim StartDT As New NotesDateTime(dtStart)
		Dim EndDT As New NotesDateTime(dtEnd)

		GetBusinessDays = 0
		bd = Evaluate({@BusinessDays([}&_
		Cdat(StartDT.DateOnly)& {];[}&_
		Cdat(EndDT.DateOnly)& {];}&_
		Me.nondays &{;}&_
		Me.holidays &_
		{)})
		GetBusinessDays = Cint(bd(0))
	End Function

End Class

To test the code, put the code into the declaration section of a button. In your “Click” event type

Sub Click(Source As Button)
	Dim dtStart As String
	Dim dtEnd As String
	dtStart = "05.06.2007"
	dtEnd = "11.06.2007"

	'Dim b As New BusinessDay("1:7","[08.06.2007]:[06.06.2007]:[07.06.2007]")
	'Dim b As New BusinessDay("","[08.06.2007]:[06.06.2007]:[07.06.2007]")
	Dim b As New BusinessDay("","")
	Msgbox b.GetBusinessDays (dtStart,dtEnd )
End Sub

SuperNTF – Beta 0.9.4 released

Kevin Pettitt released version 0.9.4 of SuperNTF on OpenNTF.

SuperNTF by Kevin Pettitt

The initial release of SuperNTF is full of goodies. The first thing you will see is the clean navigation framework. Give yourself the “Admin” role and you will see a link to the “Administration” panel, where all sorts of configuration and logging functions are visible.

You should click the “DB Config” item under “Configuration” to change some global database properties. Check out the other configuration options, and note the “code helpers” which build formula syntax for using keyword and other formulas automatically.

I highly recommend keeping soft deletions enabled, as it works VERY well, regardless of how you delete documents (including “cuts”). Also note the mouseover behavior of the trash icon (and several others).

If you write any agents, check out the “Agent Templates” which provide a couple different common agent frameworks. Note that these samples include the standard OpenLog error trapping elements.

The standard “view actions” are highly tuned to show/hide as appropriate. E.g. the “Search” button only shows if the db is full text indexed. Also visible (only on windows) are the excel export actions.

All read and edit activity is tracked, so if you want to know what you looked at yesterday, check the “My History” view. To see what your boss read yesterday, look in the “User Activity” views in the Administration section. You can also see the history of specific field value changes at the document level.

And much more…