# Logstash IMAP input unable to parse HTML email

**URL:** <https://discuss.elastic.co/t/logstash-imap-input-unable-to-parse-html-email/68951>\
**Category:** Logstash\
**Created:** [December 13, 2016, 11:41pm UTC](https://discuss.elastic.co/t/logstash-imap-input-unable-to-parse-html-email/68951 "2016-12-13T23:41:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geezer](https://avatars.discourse-cdn.com/v4/letter/g/49beb7/32.png) [@Geezer](https://discuss.elastic.co/u/Geezer)\
**Post date:** [December 13, 2016, 11:41pm UTC](https://discuss.elastic.co/t/logstash-imap-input-unable-to-parse-html-email/68951/1 "2016-12-13T23:41:55Z")

</div>

Hello,

I'm trying to use the logstash-input-imap plugin to parse email. I can read plain text emails OK but with an HTML email I get a page of HTML code as the message, rather than the text.

I have set the content\_type to text/html - am I missing something here? This is my input:

input {  
imap {  
host =\> "[server.domain.com](http://server.domain.com)"  
password =\> "\***_"  
user =\> "_**"  
tags =\> "some\_tag"  
check\_interval =\> 30 # Specified in seconds  
fetch\_count =\> 100  
type =\> "mail"  
content\_type =\> "text/html"  
}  
}

Thank you

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [December 18, 2016, 4:13pm UTC](https://discuss.elastic.co/t/logstash-imap-input-unable-to-parse-html-email/68951/2 "2016-12-18T16:13:20Z")

</div>

The imap filter doesn't parse HTML.

---

<div class="post-metadata">

**Author:** ![Geezer](https://avatars.discourse-cdn.com/v4/letter/g/49beb7/32.png) [@Geezer](https://discuss.elastic.co/u/Geezer)\
**Post date:** [December 19, 2016, 3:46pm UTC](https://discuss.elastic.co/t/logstash-imap-input-unable-to-parse-html-email/68951/3 "2016-12-19T15:46:15Z")

</div>

Ah, that would explain it thank you

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 16, 2017, 3:46pm UTC](https://discuss.elastic.co/t/logstash-imap-input-unable-to-parse-html-email/68951/4 "2017-01-16T15:46:24Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
