Skip to content

Commit 2bc9150

Browse files
author
Eddie Parker
committed
Adding a new reactor...
...for supporting Internet Explorer's kludge in not allowing .eml to be opened (and giving you no clues as to why it's not opening it, either. :P). Read detectors/filereactor.py for more information.
1 parent 2cf12e0 commit 2bc9150

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

detectors/filereactor.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
def eml_to_mht(db, cl, nodeid, oldvalues):
3+
'''
4+
This reactor fires whenever a new file entity is created.
5+
---------------------------------------------------------
6+
7+
If the file is of type message/rfc822, we tack onthe extension .eml.
8+
9+
The reason for this is that Microsoft Internet Explorer will not open
10+
things with a .eml attachment, as they deem it 'unsafe'. Worse yet,
11+
they'll just give you an incomprehensible error message. For more
12+
information, please see:
13+
14+
http://support.microsoft.com/default.aspx?scid=kb;EN-US;825803
15+
16+
Their suggested work around is (excerpt):
17+
18+
"WORKAROUND
19+
To work around this behavior, rename the .EML file that the URL links to so that it has a .MHT file name extension, and then update the URL to reflect the change to the file name. To do this:
20+
21+
1. In Windows Explorer, locate and then select the .EML file that the URL links.
22+
2. Right-click the .EML file, and then click Rename.
23+
3. Change the file name so that the .EML file uses a .MHT file name extension, and then press ENTER.
24+
4. Updated the URL that links to the file to reflect the new file name extension."
25+
26+
So... we do that. :) '''
27+
28+
name = cl.get(nodeid, 'name')
29+
type = cl.get(nodeid, 'type')
30+
31+
if type.lower() == "message/rfc822":
32+
name += '.mht'
33+
cl.set(nodeid, name=name)
34+
35+
36+
37+
def init(db):
38+
db.file.react('create', eml_to_mht)
39+

doc/upgrading.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ accordingly. Note that there is information about upgrade procedures in the
1313
Migrating from 0.7 to 0.8
1414
=========================
1515

16+
17+
0.8.0 Added filereactor detector
18+
--------------------------------
19+
20+
This reactor is not installed by default, but rather can be found in the source
21+
directory, under the detectors/ directory.
22+
23+
In it, it contains a workaround for an Internet Explorer limitation, regarding
24+
.eml and .mht files. It is tested to work with both Internet Explorer 6 and
25+
Mozilla's Firefox.
26+
27+
Read the description inside of the reactor itself, for more information.
28+
29+
1630
0.8.0 Added Dispatcher role
1731
---------------------------
1832

0 commit comments

Comments
 (0)