There is a great piece of software called nlconverter. It’s a tool designed to convert Lotus Notes’ .nsf files to mbox. It rely on win32’s COM/DDE API so it can only be used on Windows.

If you want to extract mails out of your .nsf database, this might be the tool you’re looking for. Bonus point: it’s written in Python ! ;)

Installing Nlconverter and Its Dependencies

Here is how I installed nlconverter on a Windows 2000 (SP4) machine:

  1. First I downloaded and installed the official Python builds for Windows (2.6.6 precisely):

  1. Then Python for Windows extensions (build 214 for Python 2.6 in my case):

  1. Finally I had to download the latest icalendar archive, then extract the \iCalendar-1.2\src\icalendar folder to C:\Python26\Lib\site-packages\:

  1. Next step is to download nlconverter itself and extract it:

Nlconverter GUI

First thing you have to do is to create an export of your mails as a .nsf database. Follow the previous link to get the instructions.

Now let’s convert this nsf to a mbox. nlconverter’s FAQ tells you to run the gui.exe program to perform the conversion.

Unfortunately it didn’t work for me:

So I tried the alternative approach by using the command line.

Nlconverter Command Line

Again, most of the things I’m writing here are based on nlconverter’s FAQ:

  1. First, we have to download the script from nlconverter’s mercurial repository, as this file is not distributed in the archive I unzipped previously. Let’s put in C:\winnlc-alpha-1\:

  1. Now we’ll modify the script to set the password (via the notesPasswd variable) and location (notesNsfPath variable) of the .nsf file. Here are the modifications I applied:

    :::diff —- 2010-09-02 13:49:58.000000000 +0200 +++ 2010-09-02 13:51:24.000000000 +0200 @@ -14,8 +14,8 @@ import NlconverterLib

    #Constantes -notesPasswd = “foobar” -notesNsfPath = “C:\archive.nsf” +notesPasswd = “XXXXXXXXXXXXX” +notesNsfPath = “C:\winnlc-alpha-1\kevin-notes-big-backup-part-1.nsf”

    #Connection à Notes db = NlconverterLib.getNotesDb(notesNsfPath, notesPasswd)

  2. Before running the script, we have to register a Notes DLL used by nlconverter:

    :::bat regsvr32 “C:\Program Files\Notes\nlsxbe.dll”

And make the Python interpreter available system-wide:

C:\winnlc-alpha-1>SET Path=%Path%;C:\Python26
  1. Now we can run the script:

    :::bat C:\winnlc-alpha-1>C:\Python26\python.exe

If you’re lucky, you’ll get a nice mbox at the end of the process.

But I was not and the ended up with the following error:

Traceback (most recent call last):
  File "", line 21, in <module>
    db = NlconverterLib.getNotesDb(notesNsfPath, notesPasswd)
  File "C:\winnlc-alpha-1\", line 43, in getNotesDb
    session = win32com.client.Dispatch(r'Lotus.NotesSession')
  File "C:\Python26\lib\site-packages\win32com\client\", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Python26\lib\site-packages\win32com\client\", line 104, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python26\lib\site-packages\win32com\client\", line 84, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221231, 'ClassFactory ne peut pas fournir la classe demand\xe9e', None, None)

As you can see, I tried hard to make nlconverter working, without any success. But this should not stop you to try. In fact I suspect the Lotus Notes installed on my machine to be crippled or corrupted (can’t really tell). So you may be more lucky than me. In any case, feel free to report any success or failure in the comment section below !

Related content