Skip to content

Commit

Permalink
Add missing mime4j library
Browse files Browse the repository at this point in the history
In some cases (apparently with outlook files), mime4j library is needed.
We removed it in the past which can cause elasticsearch to crash when you are using ingest-attachment (and probably mapper-attachments as well in 2.x series) with a file which requires this library.

Backport of #22764 in 5.2 branch

(cherry picked from commit cfef7c5)
  • Loading branch information
dadoonet committed Feb 1, 2017
1 parent d977725 commit 0a8a7eb
Show file tree
Hide file tree
Showing 6 changed files with 386 additions and 20 deletions.
30 changes: 10 additions & 20 deletions plugins/ingest-attachment/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ versions << [
'tika': '1.14',
'pdfbox': '2.0.3',
'bouncycastle': '1.55',
'poi': '3.15'
'poi': '3.15',
'mime4j': '0.7.2'
]

dependencies {
Expand Down Expand Up @@ -59,11 +60,19 @@ dependencies {
compile "org.apache.poi:poi-scratchpad:${versions.poi}"
// Apple iWork
compile 'org.apache.commons:commons-compress:1.10'
// Outlook documents
compile "org.apache.james:apache-mime4j-core:${versions.mime4j}"
compile "org.apache.james:apache-mime4j-dom:${versions.mime4j}"
}

// TODO: stop using LanguageIdentifier...
compileJava.options.compilerArgs << "-Xlint:-deprecation"


dependencyLicenses {
mapping from: /apache-mime4j-.*/, to: 'apache-mime4j'
}

forbiddenPatterns {
exclude '**/*.docx'
exclude '**/*.pdf'
Expand Down Expand Up @@ -530,25 +539,6 @@ thirdPartyAudit.excludes = [
'org.apache.http.client.utils.URIBuilder',
'org.apache.http.entity.ByteArrayEntity',
'org.apache.http.impl.client.DefaultHttpClient',
'org.apache.james.mime4j.MimeException',
'org.apache.james.mime4j.codec.DecodeMonitor',
'org.apache.james.mime4j.codec.DecoderUtil',
'org.apache.james.mime4j.dom.FieldParser',
'org.apache.james.mime4j.dom.address.Address',
'org.apache.james.mime4j.dom.address.AddressList',
'org.apache.james.mime4j.dom.address.Mailbox',
'org.apache.james.mime4j.dom.address.MailboxList',
'org.apache.james.mime4j.dom.field.AddressListField',
'org.apache.james.mime4j.dom.field.DateTimeField',
'org.apache.james.mime4j.dom.field.MailboxListField',
'org.apache.james.mime4j.dom.field.ParsedField',
'org.apache.james.mime4j.dom.field.UnstructuredField',
'org.apache.james.mime4j.field.LenientFieldParser',
'org.apache.james.mime4j.parser.ContentHandler',
'org.apache.james.mime4j.parser.MimeStreamParser',
'org.apache.james.mime4j.stream.BodyDescriptor',
'org.apache.james.mime4j.stream.Field',
'org.apache.james.mime4j.stream.MimeConfig',
'org.apache.jcp.xml.dsig.internal.dom.DOMDigestMethod',
'org.apache.jcp.xml.dsig.internal.dom.DOMKeyInfo',
'org.apache.jcp.xml.dsig.internal.dom.DOMReference',
Expand Down
Loading

0 comments on commit 0a8a7eb

Please sign in to comment.