You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by martin f krafft <ma...@madduck.net.INVALID> on 2025/02/24 15:11:02 UTC

Possible bug with X-Header

Hello,

I am new to Tika and not a developer, not subscribed to this list 
(please keep me on CC), but I think I may have found a bug I'd like 
to share. I only have access to Tika 2.9.1 and maybe this is an old 
issue, in which case I apologise up front.

The issue is with the attached email. If processed as is, Tika 
correctly classifies it as `message/rfc822`. However, if I add 
another `x` to the `X-Test` header, or change the name of the header 
to e.g. `X-Test2`, the message will be classified as `text/html`, 
which is wrong.

Turns out that the `X-Headers` (yes, I know they are deprecated, 
but…) throw over the detection algorithm if the header name and the 
contents exceed 138 characters in sum.

Note that it does not matter if I flow the header across multiple 
lines or not, so for simplicity, the attached message just has it on 
a single line (which technically is against the RFC SHOULD).

Hope this is a trivial bug, easy to write a test for and track down. 
Thank you for your work on Tika!

Best,

-- 
martin krafft | https://matrix.to/#/#madduck:madduck.net
  
if you are walking on thin ice, you might as well dance!
{: .blockquote }
  
spamtraps: madduck.bogus@madduck.net
{: .hidden }