Skip to content

Commit 0b96fb2

Browse files
committed
fix(JF-1083): add message/rfc822 matching
1 parent ef361a6 commit 0b96fb2

1 file changed

Lines changed: 26 additions & 27 deletions

File tree

src/main/resources/magic.xml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,6 @@
2323
<match-string offset="0">hsi1</match-string>
2424
</type>
2525

26-
<type>
27-
<mime-type>image/gif</mime-type>
28-
<extension>gif</extension>
29-
<description>GIF image data</description>
30-
<match-string offset="0">GIF8</match-string>
31-
32-
<type>
33-
<description append="true">, version 8%s,</description>
34-
<match-string offset="4">7a</match-string>
35-
</type>
36-
<type>
37-
<description append="true">, version 8%s,</description>
38-
<match-string offset="4">9a</match-string>
39-
</type>
40-
</type>
41-
4226
<type>
4327
<mime-type>image/tiff</mime-type>
4428
<extension>tif</extension>
@@ -335,7 +319,7 @@
335319
<type>
336320
<mime-type>application/x-shockwave-flash</mime-type>
337321
<extension>swf</extension>
338-
<description>Macromedia Flash data,</description>
322+
<description>Macromedia Flash data</description>
339323
<match-string offset="0">FWS</match-string>
340324

341325
<type>
@@ -460,6 +444,7 @@
460444
<description>PNG image data, CORRUPTED</description>
461445
<match-string offset="1">PNG</match-string>
462446
</type>
447+
463448
<type>
464449
<mime-type>image/gif</mime-type>
465450
<extension>gif</extension>
@@ -469,13 +454,13 @@
469454
<type>
470455
<mime-type>image/gif</mime-type>
471456
<extension>gif</extension>
472-
<description>version 8%s,</description>
457+
<description>version 87a</description>
473458
<match-string offset="4">7a</match-string>
474459
</type>
475460
<type>
476461
<mime-type>image/gif</mime-type>
477462
<extension>gif</extension>
478-
<description>version 8%s,</description>
463+
<description>version 89a</description>
479464
<match-string offset="4">9a</match-string>
480465
</type>
481466
<type>
@@ -490,14 +475,15 @@
490475
<description>%hd,</description>
491476
<match-short order="le" offset="8" comparator="&gt;">0x0</match-short>
492477
</type>
493-
494478
</type>
479+
495480
<type>
496481
<mime-type>application/x-miff</mime-type>
497482
<extension>miff</extension>
498483
<description>MIFF image data</description>
499484
<match-string offset="0">id=ImageMagick</match-string>
500485
</type>
486+
501487
<type>
502488
<mime-type>image/g3fax</mime-type>
503489
<extension>fax</extension>
@@ -551,7 +537,6 @@
551537
<match-custom>org.jadice.filetype.matchers.PDFMatcher</match-custom>
552538
</type>
553539
</type>
554-
555540
<type>
556541
<mime-type>application/pdf</mime-type>
557542
<extension>pdf</extension>
@@ -662,13 +647,12 @@
662647
<description>\b.%c</description>
663648
<match-byte order="be" offset="7"></match-byte>
664649
</type>
665-
666650
<type>
667651
<!-- Extract further PDF details -->
668652
<match-custom>org.jadice.filetype.matchers.PDFMatcher</match-custom>
669653
</type>
670-
671654
</type>
655+
672656
<type>
673657
<match-custom>org.jadice.filetype.matchers.modca.ModcaMatcher</match-custom>
674658
</type>
@@ -686,7 +670,6 @@
686670
<!-- Extracts RTF meta data -->
687671
<match-custom>org.jadice.filetype.matchers.RTFMatcher</match-custom>
688672
</type>
689-
690673
<type>
691674
<description append="true">version %c,</description>
692675
<match-byte order="be" offset="5"></match-byte>
@@ -709,6 +692,19 @@
709692
</type>
710693
</type>
711694

695+
<type>
696+
<mime-type>message/rfc822</mime-type>
697+
<extension>eml</extension>
698+
<description>RFC 822 email message</description>
699+
<match-regexp offset="0" range="20000" multiline="true">^(Message-ID:|MIME-Version:|Message-Id:)\s+</match-regexp>
700+
<type>
701+
<mime-type>message/rfc822</mime-type>
702+
<extension>eml</extension>
703+
<description>MIME email message</description>
704+
<match-regexp offset="0" range="10000" multiline="true">^MIME-Version:\s+</match-regexp>
705+
</type>
706+
</type>
707+
712708
<type>
713709
<mime-type>text/html</mime-type>
714710
<extension>html</extension>
@@ -766,6 +762,7 @@
766762
<description>ksh script</description>
767763
<match-regexp offset="0">^#!/bin/ksh</match-regexp>
768764
</type>
765+
769766
<type>
770767
<mime-type>text/html</mime-type>
771768
<extension>.html</extension>
@@ -811,11 +808,13 @@
811808
MIME type + charset will be set by the TextMatcher instance
812809
<mime-type>text/plain</mime-type>
813810
-->
814-
<description>Text file</description>
811+
<description>Plain Text file</description>
815812
<match-custom>org.jadice.filetype.matchers.TextMatcher</match-custom>
816813
</type>
817814

818815
<!-- Global fallback. If nothing else matches, it is just binary. -->
819-
<mime-type>application/octet-stream</mime-type>
820-
<description>Binary data</description>
816+
<type>
817+
<mime-type>application/octet-stream</mime-type>
818+
<description>Binary data</description>
819+
</type>
821820
</magic>

0 commit comments

Comments
 (0)