Home –> Programs (Download) –> eml2mbx [ Deutsch ]


eml2mbx  –  Program for creating mbox files

Version 0.65                Freeware                 © Jürgen Lüthje 2002-2007


Background information about the mbox format
Settings in the INI file
Example : Moving mail files to Thunderbird


eml2mbx is a 32 bit program for Windows 95/98/ME/NT/2000/XP/Vista/7, that packs separate plain text e-mail files (including all attachments) into mbox files, see also examples of e-mail conversion.


Installation is not required, just unpack the files in the ZIP archive to a directory on your hard disk or e.g. on your USB flash drive. Change the settings in the INI file if you want.
eml2mbx doesn't add entries to the Windows registry, nor does it alter anything else on the system.


Just delete the files.


Plain text e-mail files (according to RFC 2822 [4]) typically have the extension EML or MSG. This is just a convention. eml2mbx can process all these files, it's not necessary to rename them beforehand. The mail files remain unchanged.

Command:  eml2mbx <file specification> <output directory> [options]

( Example:  eml2mbx c:\temp\private\*.eml c:\data\ /p /a )

In the file specification, use  *.*  for all files. With  *  or  *.  you'll get all files without extension.
eml2mbx packs all valid e-mail files, that match the given specification, into one (or more) mbox file(s) in the output directory. The directory will be created, if necessary. The mbox files will be named after their corresponding source directories. You can specify a file extension of your choice in the INI file.

/p             In case of an error, the program does not ask the user but writes the message to the file
               %TEMP%\eml2mbx.log and tries to proceed.
/i             The program starts as an icon in the taskbar.
/a             The mails will be appended to existing mbox files with the same name, rather than overwrite them.
/s             E-mail files are collected recursively from all subdirectories.
               By default, the mails from each subdirectory are packed to an individual mbox file.
               The created directory structure is the same as used by Thunderbird.
/d             This option only has an effect in combination with option /s:
               When using /d, the mails from all subdirectories are packed together into the same mbox file.

You can combine the options like you want.

When the program ends, it returns one of the following status codes to the operating system. E.g. batch programs can read this value using the ERRORLEVEL feature (works on Windows XP, but for some reason not on Windows 98):
0   Programm successfully completed.
1   No matching file found.
2   One or more errors occured, or the user has prematurely terminated the program.
3   A severe error occured, so that the program had to be aborted.

Background information about the mbox format [1,2,3]

This is a common format for storage of mail messages. There is no precise specification of it, though. An 'mbox' is a text file containing an arbitrary number of e-mail messages. Each message is preceded by a 'postmark', and the messages are formatted according to RFC 2822 [4]. The file format is line-oriented.

The 'postmark' is a line that begins with the string “From ” (note the space!), not followed by a colon. eml2mbx writes
From support@localhost Sat Jan 01 12:00:00 2000
as separator line between the messages. Most programs use postmarks that are built after the same pattern. However, some programs create unusual postmarks, which are not recognized by some other programs.


eml2mbx normally packs mail files unaltered into mbox files. Because a “From ” line sometimes is a normal line in the text body of a mail (e.g. “From now on ...”), this way it's possible that later some programs confuse these text lines with the “From ” lines that are used as separators, and so don't recognize the begin of a new message inside an mbox file correctly. Therefore it's possible to choose respective settings in the INI file, so that eml2mbx will change “From ” lines in the text body of mails.

eml2mbx can read mail files that contain DOS/Windows line breaks (pairs of ASCII characters 13 and 10), UNIX  –  including Linux and FreeBSD  –  line breaks (ASCII 10), or Macintosh line breaks (ASCII 13), even when these are intermixed in the same file. The generated mbox files contain only DOS/Windows line breaks, and each file ends with a line break.

eml2mbx locks the mbox files while it writes to them, so that they can't be altered by other programs at the same time.
The program can create mbox files up to a size of 2 GiB.

Settings in the INI file

By means of the optional INI file, the user can change some settings. The file must be in the same directory as the program eml2mbx, and its name must be “eml2mbx.ini”.

Example of a file “eml2mbx.ini”:
DoNotChange-Begin=-----BEGIN PGP*
DoNotChange-End=-----END PGP*


Section [FromLines]

ChangeAllowed (default: false)
Possible values are false and true.
When using false, the mails will always be packed unchanged into the mbox files.
When using true, eml2mbx puts a space in front of “From ” lines in the text body of packed mails.
Because this way digital signatures of mails might become invalid, certain areas of e-mails can be prevented from changes by means of the following two settings.

DoNotChange-Begin (default: empty)
Defines the beginning of areas in e-mails, which remain unchanged even if ChangeAllowed=true.

DoNotChange-End (default: empty)
Defines the end of areas in e-mails, which remain unchanged even if ChangeAllowed=true.

matches any zero or more characters.
matches any single character.
Character comparisons are case sensitive.

So if in the example above a line in an e-mail begins with
then eml2mbx will not alter subsequent lines, until there comes another line that begins with
-----END PGP
You can use the files “Nice day_1.eml” and “Nice day_2.eml” to test the effects of particular settings in the [FromLines] section.

Section [Names]

MboxExtension (default: .mbx)
You can write an arbitrary file extension here, it will be used for all generated mbox files.

FolderExtension (default: empty)
The extension given here is used for the subfolders, which are generated by the command-line option /s.
In order to avoid naming conflicts, this extension must not be equal to the one used for MboxExtension.

In order to disable an option in the INI file, just turn it into a comment by putting a semicolon at the beginning of the line. When you only want to use the default settings of the program, you also can delete the INI file.

Example: Moving mail files to Thunderbird

Plain text e-mail files may originate e.g. from Outlook Express, DreamMail, FoxMail, or EssentialPIM, or an existing archive might contain messages in this form (see also examples of e-mail conversion).

The settings in the [Names] section of eml2mbx's INI file should be:

In order to create new Thunderbird folders, firstly use eml2mbx to pack the mails concerned into new mbox files. Quit Thunderbird if it is running, and then move the produced mbox files to the directory  Mail\Local Folders\  of the desired profile. If you have generated mbox files in subdirectories by using switch /s, then take care not to destroy the directory structure when moving the files.

In order to import mails to existing Thunderbird folders, the easiest way is to act as just described, and then move the mails inside of Thunderbird.


Mbox format
[1] http://www.faqs.org/rfcs/rfc4155.html
[2] http://www.qmail.org/man/man5/mbox.html
[3] http://en.wikipedia.org/wiki/Mbox

Internet message format
[4] http://www.faqs.org/rfcs/rfc2822.html


The program was written in Euphoria, and translated using the Euphoria To C Translator 3.1.1. Thanks to RDS for this good, free and open-source general purpose programming language, and for outstanding support.

The program uses the Euphoria programming library ARWEN 0.93c. Thanks to Michael <vulcan {AT} win.co {DOT} nz>.

The generated C code was compiled with the Borland C++ 5.5.1 Command-line Compiler. Thanks to Borland Software Corporation for having provided this powerful tool free of charge.

For bug reports I want to thank Erik Kerger and Heinz Barsties.


If you do not accept the following license, then you are not allowed to use or distribute this software.

1. Copyright
eml2mbx is copyright 2002-2007 by the author Jürgen Lüthje, all rights are reserved.

2. Right to use
eml2mbx is freeware. You may use the program free of charge and unlimited in time.

3. Copying
You may copy and distribute the software and its documentation, as long as the file eml2m065_en.zip is not modified. This means, among other things, that you are not allowed to rename the file, or split it into pieces.
Without clear written permission from the author, you are not allowed to distribute the program as part of another archive or file.
You are not allowed to sell the program, or to enclose it with a commercial program or a commercial collection of programs. The program may be distributed as part of freeware/shareware collections, e.g. on accompanying DVDs of computer magazines, though.

4. Support
You are not entitled to support by the author. However, the author tries to answer inquiries by e-mail.

5. Disclaimer
This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The author does not accept responsibility or liability for any effects, adverse or otherwise, that this code may have on you or your computer. Use it at your own risk.

Last updated 3. October 2012  –  Contact
I am not responsible for the contents of external websites.