Last Comment Bug 193281 - Ability to import/save e-mail messages from .eml text files to folders (Message|Copy)
: Ability to import/save e-mail messages from .eml text files to folders (Messa...
Status: RESOLVED FIXED
:
Product: Thunderbird
Classification: Client Software
Component: Message Reader UI (show other bugs)
: Trunk
: All All
: -- enhancement with 48 votes (vote)
: Thunderbird 11.0
Assigned To: Jim Porter (:squib)
:
:
Mentors:
: 209236 209610 244887 252452 259846 348000 362657 501109 516246 (view as bug list)
Depends on:
Blocks: 241213 269826 171907 516240 700899
  Show dependency treegraph
 
Reported: 2003-02-13 20:24 PST by Max Alekseyev
Modified: 2011-11-08 23:43 PST (History)
31 users (show)
squibblyflabbetydoo: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Workaround for Windows 2000 (1.16 KB, text/plain)
2003-10-21 02:51 PDT, Jerry Alzheimer
no flags Details
Workaround for Windows 2000 (1.16 KB, text/plain)
2003-10-21 02:51 PDT, Jerry Alzheimer
no flags Details
FIx this and test it (6.23 KB, patch)
2011-11-06 14:01 PST, Jim Porter (:squib)
mozilla: review+
Details | Diff | Splinter Review

Description Max Alekseyev 2003-02-13 20:24:01 PST
Mozilla can easily save selected messages to .eml text file. But there is no way
to perform opposite operation, i.e. import e-mail messages from .eml file. 
Such operation would be especially useful for transporting e-mail messages from
different Mozilla installations...
Comment 1 Justin Kerk 2003-02-23 20:06:59 PST
I would also find this useful, because I've forwarded some messages to myself as
.eml attachments from old accounts. I can get at them in their forwarded form
but it's no substitute for having the original senders, dates, etc.
Comment 2 Ken Hancock 2003-04-26 12:45:28 PDT
Bug seems to be similar to 171907
Comment 3 Matthias Versen [:Matti] 2003-06-12 22:57:32 PDT
*** Bug 209236 has been marked as a duplicate of this bug. ***
Comment 4 Matthias Versen [:Matti] 2003-06-16 18:05:34 PDT
*** Bug 209610 has been marked as a duplicate of this bug. ***
Comment 5 Jesper Frickmann 2003-09-03 17:51:01 PDT
I need it too. Since I finally killed Windows to go pure Linux, I need to
transfer my old Outlook mail to Mozilla :-)
Comment 6 AleGiaco 2003-09-05 11:48:16 PDT
Thunderbird 0.2 is affected by the same problem: can save .eml but cannot open
them (no menu item, no drag&drop, no doubleclick, no commandline), such a
hateful thing! :-)
Comment 7 :aceman 2003-09-25 01:18:00 PDT
Actually, importing eml is quite easy using a bit of hacking.

1. Take your eml file, copy it to your mail directory, give it a name without 
an extension, e.g. 'Import'.
2. Edit the file and add the special Moz headers to the beginning (From, X-
UIDL, X-Mozilla-Status, X-Mozilla-Status2). Just grab the first 4 lines from 
some real mail message (e.g. in your Inbox). I edited X-UIDL to be nonexistent 
(FFFFFFFF), for safety.
3. You can concatenate any number of emls into this one file, providing you add 
the headers to each of them.
4. Start Mozilla Mail and a new folder named Import should appear, containing 
all the messages you packed in the created file.

Now it is possible to move the messages around as you please. This process can 
also be automated, using some script.

But of course, native Import function in Mozilla would be easier and could have 
more functions.
Comment 8 Jerry Alzheimer 2003-10-21 02:51:22 PDT
Created attachment 133745 [details]
Workaround for Windows 2000

Maybe this helps until EML import is supported by Thunderbird
--------
@echo off
rem Setup:
rem 1) create an empty file "eml-import" (no extension) in your Thunderbird
LocalMail folder
rem 2) set EMLIMP to the FQPN of eml-import (including eml-import) - see
example below
rem 3) copy this file (ThunderbirdImporter.cmd) to %USERPROFILE%\SendTo
rem    e.g. L:\Dokumente und Einstellungen\DonMartin\SendTo
rem you now can select an eml in Explorer and use SendTo ThunderbirdImporter
rem imported emls are seen in Thunderbird, folder eml-import only after closing
and reopening Thunderbird

set EMLIMP="L:\Dokumente und
Einstellungen\DonMartin\Anwendungsdaten\Thunderbird\Profiles\default\qqs3afcr.slt\Mail\Local


Folders\eml-import"
if exist %EMLIMP% goto ONCEAGAIN
echo %EMLIMP% does not exist!!!
goto THEEND
:ONCEAGAIN
if "%1"=="" goto THEEND
echo Processing: %1 ...
rem TODO check for correct file extension to prevent importing e.g. doc
rem TODO check if already this header is contained in the eml file 
echo From - Tue Oct 21 11:22:33 2003 >> %EMLIMP%
echo X-UIDL: FFFFFFFF >> %EMLIMP%
echo X-Mozilla-Status: 0001 >> %EMLIMP%
echo X-Mozilla-Status2: 00000000 >> %EMLIMP%
type %1 >> %EMLIMP%
shift
goto ONCEAGAIN

:THEEND

------
Comment 9 Jerry Alzheimer 2003-10-21 02:51:47 PDT
Created attachment 133746 [details]
Workaround for Windows 2000

Maybe this helps until EML import is supported by Thunderbird
--------
@echo off
rem Setup:
rem 1) create an empty file "eml-import" (no extension) in your Thunderbird
LocalMail folder
rem 2) set EMLIMP to the FQPN of eml-import (including eml-import) - see
example below
rem 3) copy this file (ThunderbirdImporter.cmd) to %USERPROFILE%\SendTo
rem    e.g. L:\Dokumente und Einstellungen\DonMartin\SendTo
rem you now can select an eml in Explorer and use SendTo ThunderbirdImporter
rem imported emls are seen in Thunderbird, folder eml-import only after closing
and reopening Thunderbird

set EMLIMP="L:\Dokumente und
Einstellungen\DonMartin\Anwendungsdaten\Thunderbird\Profiles\default\qqs3afcr.slt\Mail\Local


Folders\eml-import"
if exist %EMLIMP% goto ONCEAGAIN
echo %EMLIMP% does not exist!!!
goto THEEND
:ONCEAGAIN
if "%1"=="" goto THEEND
echo Processing: %1 ...
rem TODO check for correct file extension to prevent importing e.g. doc
rem TODO check if already this header is contained in the eml file 
echo From - Tue Oct 21 11:22:33 2003 >> %EMLIMP%
echo X-UIDL: FFFFFFFF >> %EMLIMP%
echo X-Mozilla-Status: 0001 >> %EMLIMP%
echo X-Mozilla-Status2: 00000000 >> %EMLIMP%
type %1 >> %EMLIMP%
shift
goto ONCEAGAIN

:THEEND

------
Comment 10 Max Alekseyev 2003-11-14 10:49:29 PST
Comment on attachment 133745 [details]
Workaround for Windows 2000

removing dup
Comment 11 Michael Kuznik 2004-03-11 00:08:11 PST
Since few months in our company we are using mozilla-mail, because we have
windows and Linux-Clients and wanted to use the same mail-client for everyone.
Now our users uses the "save as eml-File" function to save the mail(s) in a
folder of i.e. a project for a customer. In such a folder is saved everything to
this project, i.e. facsimiles, letters, mails etc.. So everyone can go to the
project-folder i.e. project-number 12345 and sees all what's going on in that
project.
Now when he/she want's to open the saved mail it's not working. And I can't tell
a normal office-user to use such a workaround!
I think other companies do have the same problems but they havend own edv
employees (because of outsourcing) and "normal office-users" are afraid of using
bugzilla :) or they don't know that bugzilla exists.
Comment 12 Henrik Skupin (:whimboo) 2004-04-20 04:40:44 PDT
This was fixed in bug 239555 on 2004-04-14.

*** This bug has been marked as a duplicate of 239555 ***
Comment 13 Justin Kerk 2004-04-20 08:15:45 PDT
I don't think this is a dupe of 239555 - that bug is about opening a .eml file
in a message window. This is about importing a .eml file into your mailbox along
with all your other mail messages. It looks like some of the bugs that have been
duped against this one should be dupes of 239555, which isn't helping.
Comment 14 Mike Cowperthwaite 2004-04-20 09:06:48 PDT
You're right, this isn't a dupe.
Comment 15 Mike Cowperthwaite 2004-04-21 08:33:53 PDT
See bug 241213.
Comment 16 Zbigniew Luszpinski 2004-05-20 04:36:28 PDT
Mozilla Thunderbird 0.6 can open *.eml files :). But without graphics :( yet. 
Comment 17 Mike Cowperthwaite 2004-05-20 07:41:48 PDT
The problem with graphics not showing in a .EML file is bug 174692.
Comment 18 Bogdan Stroe 2004-05-27 18:53:52 PDT
*** Bug 244887 has been marked as a duplicate of this bug. ***
Comment 19 Simon Umbricht 2004-07-21 09:33:52 PDT
*** Bug 252452 has been marked as a duplicate of this bug. ***
Comment 20 Mike Cowperthwaite 2004-08-24 15:55:47 PDT
In bug 174692 comment 22, someone has posted a URL to a bash script which is 
supposed to perform the integration of a .EML into mail.
Comment 21 Mike Cowperthwaite 2004-09-21 14:39:11 PDT
*** Bug 259846 has been marked as a duplicate of this bug. ***
Comment 22 PJ Richardson 2004-10-16 11:59:16 PDT
Workaround: Drag-n-drop selected files into Outlook Express, then import mail 
from Outlook Express into Thunderbird. I still had my OE install from before I 
switched, conveniently empty of messages.
Comment 23 Stephen Lee 2005-10-20 05:23:40 PDT
Why does this depend on bug 241213 and bug 241216? I would have thought it
possible to have a suitable drag-drop handler without implementing an import
user-interface elsewhere.

The workaround in comment #9 suggests that the internal mailbox storage is
sufficiently similar to a .eml file that the import mechanism should be only
need to be slightly different to the existing drag-drop handlers that deal with
moving mail between different local folders.

Anyway, following advice from comment #22, I used the convenient "mail file
import tool for Thunderbird" called "Outlook Express" that Microsoft were kind
enough to provide for free :-)
Comment 24 John Navas 2005-10-20 11:55:52 PDT
Email import is included in AusDilecce's TB AutoSave Extension
http://www.supportware.net/mozilla/#ext13
Comment 25 Mike Cowperthwaite 2006-05-19 07:37:40 PDT
(In reply to comment #23)
> Why does this depend on bug 241213 and bug 241216? I would have thought it
> possible to have a suitable drag-drop handler without implementing an import
> user-interface elsewhere.

This bug isn't (necessarily) about drag-and-drop; that's bug 171907.  However, drag-and-drop is an insufficient UI, as it's not accessible; using the 
Message|Copy menu from the message window (or something similar) needs to be done for .EML files.  Also for message/rfc822 attachments -- which is 
bug 204612.  However, you're right -- the dependencies are incorrect.
Comment 26 Johannes Buchner 2006-08-09 03:46:26 PDT
*** Bug 348000 has been marked as a duplicate of this bug. ***
Comment 27 Magnus Melin 2006-12-04 09:15:45 PST
*** Bug 362657 has been marked as a duplicate of this bug. ***
Comment 28 Przemyslaw Bialik 2007-08-11 08:52:52 PDT
For your import needs there's great ImportExportTools extension (for thunderbird) - http://nic-nac-project.de/~kaosmos/mboximport-en.html
Comment 29 Dmitry 2009-06-29 14:17:44 PDT
*** Bug 501109 has been marked as a duplicate of this bug. ***
Comment 30 Mark Banner (:standard8) 2009-09-13 07:18:56 PDT
*** Bug 516246 has been marked as a duplicate of this bug. ***
Comment 31 Dmitry G. Kozhinov 2010-01-26 09:56:54 PST
You don't need to drag-drop .eml files into Outlook Express, and then import from Outlook Express. You can drag-drop into Thunderbird.

We need a menu command for this. Drag-drop (only) is not sufficient and not obvious.
Comment 32 patrice Arnal 2010-02-22 06:35:30 PST
There are some side effects with the .eml files :
When I opened an attached .eml file, or directly a previously saved .eml file, it shows up with the "reply", "foward" etc buttons in Thunderbird 3.
If I hit "reply", a new window appears, with the correct addresses, But 
1- the auto-save and save as draft ends with an error
2- the sending is not possible (same error)
BUT
the "send-later" feature is working and I can then move the reply to the drafts folder and edit it......
Comment 33 Jim Porter (:squib) 2011-11-06 14:01:23 PST
Created attachment 572335 [details] [diff] [review]
FIx this and test it

Here's a fix for this. It enables Message > Copy and "Copy" in the context menu. Note that this only works for .eml files, not attached emails, since the copy service can't handle attached emails yet.
Comment 34 David :Bienvenu 2011-11-08 13:31:09 PST
Comment on attachment 572335 [details] [diff] [review]
FIx this and test it

thx for the patch - can you replace "1" with Ci.nsMsgMessageFlags.Read (or Components.interfaces.nsMsgMessageFlags.Read, whichever works...). Other than that, r=me.
Comment 35 Jim Porter (:squib) 2011-11-08 18:49:27 PST
Checked in: http://hg.mozilla.org/comm-central/rev/d8ca97163b22
Comment 36 Thomas D. (currently busy elsewhere; needinfo?me) 2011-11-08 23:06:48 PST
(In reply to patrice Arnal from comment #32)
> There are some side effects with the .eml files :
> When I opened an attached .eml file, or directly a previously saved .eml
> file, it shows up with the "reply", "foward" etc buttons in Thunderbird 3.
> If I hit "reply", a new window appears, with the correct addresses, But 
> 1- the auto-save and save as draft ends with an error
> 2- the sending is not possible (same error)
> BUT
> the "send-later" feature is working and I can then move the reply to the
> drafts folder and edit it......

Patrice, can you check if we have a bug for that problem (confirmed), and file a new bug with more details (steps to reproduce, actual results, expected results) if we don't?
Comment 37 Thomas D. (currently busy elsewhere; needinfo?me) 2011-11-08 23:15:46 PST
(In reply to Jim Porter (:squib) from comment #35)
> Checked in: http://hg.mozilla.org/comm-central/rev/d8ca97163b22

Jim, thank you!! That's good news!
Comment 38 Jim Porter (:squib) 2011-11-08 23:20:49 PST
(In reply to patrice Arnal from comment #32)
> There are some side effects with the .eml files :
> When I opened an attached .eml file, or directly a previously saved .eml
> file, it shows up with the "reply", "foward" etc buttons in Thunderbird 3.
> If I hit "reply", a new window appears, with the correct addresses, But 
> 1- the auto-save and save as draft ends with an error

On my system (11.0a1) this fails...

> 2- the sending is not possible (same error)

... but this works.

(1) already has a bug filed on it (bug 548070), so I think we're ok as far as followups go. There's also bug 389650, which is probably caused by the same underlying issue.
Comment 39 patrice Arnal 2011-11-08 23:43:00 PST
You are right : bug 548070 is almost the same as mine.

I use Thunderbird 7.0.1 on an Ubuntu 11.10 64 bits architecture

I will fill other comments under this bug.
Thanks

Note You need to log in before you can comment on or make changes to this bug.