# Problem of plugin logstash-input-imap

**URL:** <https://discuss.elastic.co/t/problem-of-plugin-logstash-input-imap/24155>\
**Category:** Logstash\
**Created:** [June 23, 2015, 8:27am UTC](https://discuss.elastic.co/t/problem-of-plugin-logstash-input-imap/24155 "2015-06-23T08:27:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Penny\_Lee](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Penny\_Lee](https://discuss.elastic.co/u/Penny_Lee)\
**Post date:** [June 23, 2015, 8:27am UTC](https://discuss.elastic.co/t/problem-of-plugin-logstash-input-imap/24155/1 "2015-06-23T08:27:44Z")

</div>

Hi, I was doing the email input to logstash using plugin input imap.  
[[https://github.com/logstash-plugins/logstash-input-imap](https://github.com/logstash-plugins/logstash-input-imap)][1]

```
    input {
                imap {
                        type => mail
                        host => "imap.gmail.com"
                        user => "user.name"
                        password => "P@ssw0rd"
                        port => 993
                }
        }
        filter {
                if [type] == "mail" {
                                        mutate {
                                                remove_field => ["received"]
                                        }
                }
        }
        output {
          elasticsearch { host => localhost }
          stdout { codec => rubydebug }
        }
        
From the logstash.err
        Jun 23, 2015 4:02:59 PM org.elasticsearch.node.internal.InternalNode <init>
        INFO: [logstash-ELK-17245-12856] version[1.5.1], pid[17245], build[5e38401/2015-04-09T13:41:35Z]
        Jun 23, 2015 4:02:59 PM org.elasticsearch.node.internal.InternalNode <init>
        INFO: [logstash-ELK-17245-12856] initializing ...
        Jun 23, 2015 4:02:59 PM org.elasticsearch.plugins.PluginsService <init>
        INFO: [logstash-ELK-17245-12856] loaded [], sites []
        IOError: closed stream
                close at org/jruby/RubyIO.java:2098
             teardown at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-imap-0.1.4/lib/logstash/inputs/imap.rb:147
          inputworker at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/pipeline.rb:203
          synchronize at org/jruby/ext/thread/Mutex.java:149
          inputworker at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/pipeline.rb:203
          start_input at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/pipeline.rb:171
        
From the logstash.log
        {:timestamp=>"2015-06-23T16:03:04.823000+0800", :message=>"A plugin had an unrecoverable error. Will restart this plugin.\n Plugin: <LogStash::Inputs::IMAP type=>\"mail\", host=>\"imap.gmail.com\", user=>\"infra.gcp\", folder=>\"INBOX\", content_type=>\"text/plain\">\n Error: Lookup failed l127mb189101572itg", :level=>:error}
        {:timestamp=>"2015-06-23T16:03:06.721000+0800", :message=>"A plugin had an unrecoverable error. Will restart this plugin.\n Plugin: <LogStash::Inputs::IMAP type=>\"mail\", host=>\"imap.gmail.com\", user=>\"infra.gcp\", folder=>\"INBOX\", content_type=>\"text/plain\">\n Error: Lookup failed vu6mb55309015igb", :level=>:error}

```

I am not sure what is going on of the Error: Lookup failed, the INBOX have the unread email and no attachment.  
Any workaround?  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Penny\_Lee](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Penny\_Lee](https://discuss.elastic.co/u/Penny_Lee)\
**Post date:** [June 24, 2015, 9:01am UTC](https://discuss.elastic.co/t/problem-of-plugin-logstash-input-imap/24155/2 "2015-06-24T09:01:25Z")

</div>

Oh no still error.

---

<div class="post-metadata">

**Author:** ![michaellizhou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaellizhou/32/4143_2.png) [@michaellizhou](https://discuss.elastic.co/u/michaellizhou)\
**Post date:** [June 24, 2015, 9:47pm UTC](https://discuss.elastic.co/t/problem-of-plugin-logstash-input-imap/24155/3 "2015-06-24T21:47:30Z")

</div>

I never tried to use the mail server as an input so this may sound like a silly question, did you try to re-install/install the plugin? I would think when your logstash instance starts up it should mention that but it goes straight to IOerror.

---

<div class="post-metadata">

**Author:** ![Penny\_Lee](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Penny\_Lee](https://discuss.elastic.co/u/Penny_Lee)\
**Post date:** [June 25, 2015, 1:36am UTC](https://discuss.elastic.co/t/problem-of-plugin-logstash-input-imap/24155/4 "2015-06-25T01:36:56Z")

</div>

oh thanks your advice. it re-installed and still output the same message ☹  
I am using logstash 1.5, and jruby 1.5.6 (ruby 1.8.7 patchlevel 249) (2014-02-03 6586) (Java HotSpot(TM) 64-Bit Server VM 1.8.0\_45) [amd64-java]

---

<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:** [July 6, 2017, 5:36am UTC](https://discuss.elastic.co/t/problem-of-plugin-logstash-input-imap/24155/5 "2017-07-06T05:36:33Z")

</div>


