Preserve Mail quote levels?

Is there, or could there be, any way to save messages/mailboxes from Apple Mail to DT with quote levels preserved?
Using the excellent DT scripts with Mail 2.0.5 and DT 1.0.2, everything seems to be flattened. Still fine for searching, but makes reading imported mails somewhat confusing.

Two ways, but they only work a single message at a time:

[1] Save a message in PDF format to DT Pro. While viewing a Mail message, select File > Print. When the Print panel appears, click on the PDF button, then select Save to DEVONthink Pro.scpt. You will be asked to chose the target group in your database.

Note: If you get an error message, do this: Locate the script in ~Library/PDF Services. Double-click on it to open it under Script Editor. Now press Command-S to save it to the same location. Quit Script Editor. The script will now function properly.

[2] In DT Pro, select Tools > Show Groups. Now make Mail the frontmost application and open a message. Press Command-A to select the message text, then drag & drop it to a desired folder in the Groups panel. Note: If both the header and message body cannot be selected, it will be necessary to transfer the information in two steps. Transfer the header information as described, then copy the message body to the clipboard, locate the new document in DT Pro, and append the message body by pasting it into the document.

Thanks Bill. It’s almost as useful to know what can’t be done as what can. Transferring messages one at a time by this method however is not going to be a practical way of archiving several years worth of mail.

In case other DT users see this as a problem, what I shall probably end up doing is using Andreas Aman’s freeware Mail Scripts to export mailboxes to rtf files, and then importing those into DT. Not only does this preserve coloured quote levels, there are many other useful options: dates of mails to include, what sort of headers, and whether to include attachments. It is possible to include each mail in a separate file, and to preserve the original mailbox hierarchy but I’d probably conglomerate them. The only downside I can see is that you don’t get the reply button in BT, but since the optional headers include the senders address, this is really only a cosmetic issue.

It would be nice if the DT mail import script could be adapted to optionally import mailboxes as rtf, but until such time as I or anyone else finds time (and in my case the necessary skill) to do this, Mail Scripts seem to offer an elegant bridge, with several other useful scripts besides archiving and exporting.

Hi Nick,

Thanks for the suggestion re Mail Scripts. I gave the archiving script a try but it gave me error messages and then just locked up and I had to force quit both Mail and the script. Looked intriguing.


Sorry you had problems with Mail Scripts Alexandria. They have always been very solid for me, though having to move a lot of stuff around via AS can be slow.
Make sure that you are choosing Export rather than Archive in the dialogue, and try with one relatively small mbox to start with, just to make sure it is working as you expect. It is also possible that some combinations of settings work better than others, so if you continue to have problems, report back and I’ll tell you exactly how I have it set up.

Hi Nick. I did both things you suggested—set it up as Export and with a small mailbox to start. I selected ‘message after’ and set a date and that was about it. Disappointing, because it really looked very intriguing to start. Right now I’m using the DT Pro script to move messages and/or mailboxes, but of course it’s all plain text so having them transfer as rtf files would have been quite useful.

But perhaps someone else can use them, and in any case it was good of you to post the suggestion.


Well you have me worried now. I was using Archive script without any date filter, so I tried with Messages After…2003 (and Rich Text/Include Attachments/Single File). It announced that 68 files had been successfully exported, but when I looked in the rtf there were only about 5. I then retried without the date filter and found that I was still getting a random fraction, so perhaps it has not been as reliable as I thought all along. I suggest contacting the developer of Mail Scripts, because this is clearly a very conscientiously maintained product, so I’m sure he would welcome feedback if it is not working as it should. I’ll experiment a bit more myself when I have the time. No crashes or freezes though.

Ah well.

Alexandria —Andreas Amann has now updated Mail Scripts to version 2.7.10. This resolves my issues with apparently truncated rtfd exports, and perhaps it will resolve yours. I have found these scripts to be extremely robust, so if you find that you are still having problems, I would not necessarily assume that the scripts themselves are at fault.

I should clarify one thing about the way in which Archive Messages preserves quote levels in exported text: it does not reproduce the text styles in the original mail, rather it recognises quote levels per se, and represents them with standard Mail quote colours. If you have not changed your default quote colours, then the difference is academic. It is also worth knowing that while regular, italic and bold styles in rtf emails are preserved, original colours and fonts are not.

Hi Nick,

I’ll give the another try. I would sure like to find a solution such as this for archiving mail, so it’s definitely worth another shot. Many thanks,



I tried the new script again without much success. It worked fine on a folder/mailbox with 14 messages. It locked up completely, both Script and Mail, with a folder full of over 1000 messages, which is my saved mail folder (I use smart mailboxes to filter mail and keep all saved mail in one folder). I got the same error message on a folder of 155 messages when I tried to filter out the needed messages first then export them. It just isn’t working for me. But DT’s script for adding messages/mailboxes works flawlessly, though without formatting. So, I’m stuck with that. :confused: It was worth a try!


Alexandria, I don’t want to encourage you to waste your time, but there must be a reason why it is locking up on you, and I would bet that Andreas would be glad to help you work it out.
Just to convince myself, I exported my 1652 message “Software” mailbox, complete with attachments to a 64 Mb rtfd. It took nearly 20 minutes, but went through without a hitch.

Yeah, I tried exporting another mailbox just to be sure and I got the same error message I got before with the earlier version. I wrote to the developer as you suggested, but to be honest, I just don’t have much time to spend on such things. I have a clean running, happy system that I maintain regularly, and I am so very busy with trying to complete a dissertation! But I am trying again just because I LOVE the idea of exporting mail as rtfd files, with working links, etc. And then transferring them into DT. Yes, with the single mailbox I was able to export it worked great! So, we’ll see. Thanks again,