Lotus Notes’ Rich Text to MIME conversion error

Today I encountered a strange error while using Lotus Notes. I had a “Cannot convert Notes Rich Text message to MIME message” error:

This was triggered when I tried to move certain mails from one account to another. And to add insult to injury, this nasty and dangerous error will make you loose data.

Let’s say you want to cut and paste a batch of 10 mails. Then that error occurs while Notes paste the 3rd message. It means you’ll loose the last 7 messages of your batch. Why ? The 10 messages will be removed from their original location on cutting, and the last 7 messages will be trapped in the copy buffer. Isn’t that a reasonable reason to hate Lotus Notes ?

Anyway. After several tests and experiments, I finally found the common property shared by all those reluctant messages. They all have inline images embedded in the body of the mail, like the one below:

In mail edit mode, you can get properties of these objects and get confirmation that they are inline images:

As you can see above, the edit mode lets you manipulate (cut, copy, paste, …) these embedded pictures. Let’s take advantage of this to fix our initial issue.

Here is my procedure to make these mails pass through the conversion error:

  1. In Notes’ edit mode, cut all inline pictures, one picture at a time;
  2. For each cutted picture, paste it as a new image in the image editor of your choice (Gimp did the trick for me);
  3. Save each image on your local disk;
  4. Now that all inline images are removed from the original mail, attach (but don’t paste) to it all the images you saved in the previous step;
  5. Finally, save mail modifications in Notes and you’ll be able to move the mail without the conversion error.

This is really dirty, and isn’t bearable past a few mails. But that’s the only solution I found so far. Of course if you have a superior/automated way to address this lame bug, I’ll be happy to hear that ! :)

Setup a lightweight IMAP server on MacOS X Leopard with Dovecot

Last week I needed a local IMAP server on MacOS X Leopard (10.5) for temporary testing. After struggling with courier-imap for hours, I’ve finally settled on Dovecot. You’ll see below how easy it is to install and configure it.

We’re lucky, Dovecot is available in Mac Ports, so we can install it easily:

port install dovecot

It’s time to configure it. We start with the default configuration template:

cp /opt/local/etc/dovecot/dovecot-example.conf /opt/local/etc/dovecot/dovecot.conf

Then we can edit the dovecot.conf configuration file as we wish. FYI, here are my modifications:

--- /opt/local/etc/dovecot/dovecot-example.conf	2010-04-23 14:29:52.000000000 +0200
+++ /opt/local/etc/dovecot/dovecot.conf	2010-04-23 14:51:06.000000000 +0200
@@ -21,7 +21,7 @@

 # Protocols we want to be serving: imap imaps pop3 pop3s
 # If you only want to use dovecot-auth, you can set this to "none".
-#protocols = imap imaps
+protocols = imap

 # A space separated list of IP or host addresses where to listen in for
 # connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
@@ -45,7 +45,7 @@
 # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
 # matches the local IP (ie. you're connecting from the same computer), the
 # connection is considered secure and plaintext authentication is allowed.
-#disable_plaintext_auth = yes
+disable_plaintext_auth = no

 # Should all IMAP and POP3 processes be killed when Dovecot master process
 # shuts down. Setting this to "no" means that Dovecot can be upgraded without
@@ -221,7 +221,7 @@
 #
 # <doc/wiki/MailLocation.txt>
 #
-#mail_location =
+mail_location = maildir:~/Maildir

 # If you need to set multiple mailbox locations or want to change default
 # namespace settings, you can do it by defining namespace sections.

Before starting Dovecot, we have to create a dummy SSL certificate:

mkdir -p /opt/local/etc/ssl/{certs,private}
openssl req -new -x509 -days 3650 -nodes -out /opt/local/etc/ssl/certs/dovecot.pem -keyout /opt/local/etc/ssl/private/dovecot.pem

And finally, we can launch the Dovecot server itself as root:

dovecot

That’s all !

You can now access your local IMAP server with any client. Here is an example with Thunderbird:

And if you have problems, the first reflex is to read dovecot’s logs:

tail -F /var/log/mail.log