The title may sounds pretentious but extracting mails out of Lotus Notes is soooo hard and complicated, that achieving such a task feels like winning an epic battle against the forces of evil.

Anyway. The goal of this post is to help you migrate all your Lotus Notes mails to a more convenient and standard format like maildir or mailbox.

There are several ways of extracting all your mail trapped in Lotus Notes’ proprietary databases.

Method #1: using integrated IMAP service  ¶

This is probably the simplest method. It consists in using the Lotus Notes desktop client (were your emails currently resides) as an IMAP client.

Essentially, what you have to do is just to create a secondary account linked to an IMAP server, like Gmail, etc. This works well and is explained in details in this tutorial  .

But sometimes your Notes client is behind firewalls and proxys. So you can’t reach the Internet.

And some other times, Lotus Notes clients are crippled and don’t let you create an IMAP connexion. Unfortunately this happened to me:

So I had to found another approach.

Method #2: using nlconverter  ¶

This method is explored in details in my previous article  .

But again, it seems that the Lotus Notes on my machine was crippled and/or corrupted. The nlconverter GUI gave me this error:

And the command line gave me this:

Traceback (most recent call last):
  File "notes2mbox.py", line 21, in <module>
    db = NlconverterLib.getNotesDb(notesNsfPath, notesPasswd)
  File "C:\winnlc-alpha-1\NlconverterLib.py", line 43, in getNotesDb
    session = win32com.client.Dispatch(r'Lotus.NotesSession')
  File "C:\Python26\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 104, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", 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)

After these two failed attempts, I was quite depressed and not far from surrender to the evil power of proprietary software. Then I managed to setup a new (but complicated) strategy.

Method #3: using Lotus Notes client for Mac OS X  ¶

This is the only method that worked for me, and basically, is the same as the first one, but on Mac OS X. Additionally, it involves a local mail server. This procedure was tested several times on Mac OS X Leopard  .

  1. First things first, download the trial version of Lotus Notes client for Mac OS X (unfortunately you have to register) and install it. I used Lotus Notes 7.0.3 for Mac OS X Leopard:

![]({attach}lotus-notes-mac-osx-leopard-install.png)
  1. You’ll be welcomed by a wizard  :

![]({attach}lotus-notes-wizard-screen-1.png)
  1. On the next screen, enter a dummy name and uncheck the “ I want to connect to a Domino server ” box:

![]({attach}lotus-notes-wizard-screen-2.png)
  1. Then proceed to the next step in which you’ll uncheck “ Setup instant messaging  ”:

![]({attach}lotus-notes-wizard-screen-3.png)
  1. In the last screen, uncheck all boxes. We don’t want to setup any other service yet:

![]({attach}lotus-notes-wizard-screen-4.png)
  1. Initial setup is now complete:

![]({attach}lotus-notes-wizard-screen-5.png)

You can now launch Lotus Notes:

![]({attach}launch-lotus-notes-for-mac-osx.png)

![]({attach}lotus-notes-7-on-mac-osx-leopard.png)
  1. On first run, there will be the following screen, where you should click on the “ No thanks, just give me the defaults  ”:

![]({attach}lotus-notes-wizard-screen-6.png)
  1. You’ll end up on what will be your default Lotus Notes main page from now on:

![]({attach}lotus-notes-wizard-screen-7.png)
  1. The next step is to go back to the machine (Windows for me) from which you’re running the Notes client containing all the mails you plan to migrate. From there, export your mail database  :

![]({attach}export-screen.png)

All details of this operation can be found in [this dedicated article
]({filename}/2010/how-to-export-backup-lotus-notes-mails.md).
  1. Then go back to your Mac OS X machine and import your freshly exported .nsf database. This is as simple as opening the file via the File > Database > Open... menu and dialog:

![]({attach}lotus-notes-database-opening.png)

![]({attach}lotus-notes-open-database-dialog.png)
  1. When Notes attempts to open the file, you’ll be prompted by several dialogs regarding the security attached to the database. If you get the “ Create Cross Certificate ” screen, then just answer “ Yes ” as below:

![]({attach}lotus-notes-cross-certificate-creation-dialog.png)

And every time you get an "_Execution Security Alert_" message, always check
the "_Start trusting the signer to execute this action_" option before clicking
"_OK_":

![]({attach}lotus-notes-execution-security-alert-dialog.png)
  1. The client will then rebuild the index before giving you a plain view of your inbox:

![]({attach}lotus-notes-database-import.png)

![]({attach}lotus-notes-database-successful-import.png)
  1. Next step is to setup a local IMAP server:

![]({attach}dovecot-on-macosx.png)

As you can see I [used Dovecot, and all is explained here
]({filename}/2010/setup-lightweight-imap-server-macos-leopard-dovecot.md).
  1. Now it’s time to create a new account in Lotus Notes to access this local IMAP server. Click on the Address Book in your toolbar and add a new Account :

![]({attach}lotus-notes-address-book-icon.png)

![]({attach}lotus-notes-create-new-mail-account.png)
  1. Here is where you configure Notes to let it be aware of our local server existence. Only the first tab must be changed to your local parameters. You can left the last two tabs untouched:

![]({attach}lotus-notes-local-imap-config.png)
  1. Open within Notes your local IMAP mailbox. It is found in the workspace, which you can access via the Databases icon on your toolbar:

![]({attach}lotus-notes-open-workspace.png)

![]({attach}lotus-notes-workspace.png)
  1. You’ll be welcomed by a useless help screen:

![]({attach}lotus-notes-imap-welcome-screen.png)

Just close it to get your local IMAP mail view:

![]({attach}lotus-notes-local-imap-mailbox-view.png)
  1. While trying to opening the local IMAP mailbox, you may encounter this TCPIP port error:

![]({attach}lotus-notes-tcp-ip-error.png)

In this case, please have a look at my other [article explaining how to open
TCPIP port in Lotus Notes
]({filename}/2010/how-to-fix-lotus-notes-disabled-tcp-ip-port-error.md).
  1. For this step, just copy or cut, then paste, mails from your local .nsf database to your local IMAP account:

![]({attach}lotus-notes-copy-nsf-mails.png)

![]({attach}lotus-notes-copying-nsf-mails.png)

![]({attach}lotus-notes-paste-mails-to-local-imap.png)

![]({attach}lotus-notes-pasting-mails-to-local-imap.png)

![]({attach}lotus-notes-mails-migrated-to-local-imap.png)
  1. While playing with copy’n’paste, you may encounter this error:

![]({attach}notes-rich-text-to-mime-conversion-error.png)

A [workaround can be found in this article
]({filename}/2010/lotus-notes-rich-text-mime-conversion-error.md).
  1. Finally, if like me you’ve played a lot with mails during the transfer step above, you may ends up with loads of duplicate mails. In this case have a look at the deduplication script I wrote. It will help you clean-up your Maildir folder.

  2. That’s it! You now have a standard Maildir of your Lotus Notes mails, located in your user home directory ( ~/Maildir ):

![]({attach}maildir-containing-lotus-notes-mails.png)

My ultimate action was to convert the Dovecot maildir to Kmail maildir , as I wanted to use Kmail to finally upload everything in Gmail. But you can use anything that suit your needs, like thunderbird or any mail conversion tools.

Method #4: Lotus Notes client v8.5 on Mac OS X Leopard  ¶

The same procedure as in method #3 can be performed with the trial version of the Lotus Notes client v8.5, running on Mac OS X Snow Leopard  .

Here are the equivalent screenshots:

Method #5: Lotus Notes client on Windows XP  ¶

I just tried the first method again (IMAP connection with Note’s fat client). But this time I installed Lotus Notes 8.5.2 trial version on a fresh Windows XP running within a QEMU instance.

As you can see, it works:

With simple copy’n’paste, I was able to migrate several batch of mails. Until the target notes-import folder on my Gmail account reached 2000+ mails, at which point my Notes client freezed hard. So I’m stuck with only part of my mails migrated. Again, this is not the solution I’m looking for, as it can’t handle large quantity of mails. :(

Conclusion  ¶

  • Lotus Notes sucks. Everybody knows that , but I feel liberated saying that! ;)

  • The smartest thing to do is to avoid Notes like the plague in the first place. Sadly when working for the man, it’s not always possible… :(

  • The only method I found to work for me (the third solution in this article) is far from perfect from my point of view. What I dream about is a 100% automated solution, like a command line utility we can name nsf2maildir . And as I don’t plan to own Apple hardware and software in a near future, such a command should be 100% free software and running on Linux. I really think there is a “market” for a free software component able to read and understand .nsf files. Any motivated volunteer? ;)