On Wed, 18 Sep 2002 06:26:27 -0400 Apparatus <[EMAIL PROTECTED]> wrote:

> Attached is some code I wrote to convert messages received in Mahogany
> to the mbox format. Hopefully some export features will be included into
> this great email client.

Mahogany can already do this very nicely.  Create a MBOX style mailbox and
move or copy your desired messages into it.

If you have Perl, you can also use my mbx_find.pl tool which may be found
in http://home.ix.netcom.com/~mchase/zip/ if you would rather convert
messages outside Mahogany.

Even for incoming messages, you can't count on "Return-Path: <" being the
second line of a message.  You will also get a false trigger for messages
attached to other messages or included as text.  MBX files also have a 2048
byte file header that you must skip before you start reading message lines.
That requires you to open the file in binary mode.

I describe the layout of the message start lines for both MBX and MBOX
files in bSeparator() and bWriteMessage() in MAC_MailBox.pm.  Without the
MBOX message start line, you haven't created a MBOX file, just a
concatenated set of message lines.  Also, if you aren't parsing the MBX
message start lines, you are missing the correct message start point and
you are losing the message status flags that need to be added to the
message header in the "Status:" and "X-Status:" lines in MBOX files.

You can download the Mahogany source and look in
M/extra/src/c-client/mmdf.h to see how a MBOX message start line can be
parsed in C.  It also has several examples of MBOX message start lines.
You can get a start for understanding the file formats by looking in
M/extra/src/c-client/mbx.c and M/extra/src/c-client/mbox.c.
-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.



-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
_______________________________________________
Mahogany-Developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-developers

Reply via email to