IMAP Input Plugin and Gmail

This question has already been posted but wihtout answer.

I got this error when tryiing to use IMAP plugin in order to collect email from Gmail Imap SSL account:

[2020-02-06T22:04:16,642][ERROR][logstash.inputs.imap     ] Encountered error NoMethodError {:message=>"Can not decode an entire message, try calling #decoded on the various fields and body or parts if it is a multipart message.", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/mail-2.6.6/lib/mail/message.rb:1903:in `decoded'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:163:in `parse_mail'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:118:in `block in check_mail'", "org/jruby/RubyArray.java:1800:in `each'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:112:in `block in check_mail'", "org/jruby/RubyArray.java:1842:in `each_slice'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:110:in `check_mail'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:91:in `block in run'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/stud-0.0.23/lib/stud/interval.rb:20:in `interval'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:90:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:314:in `inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:306:in `block in start_input'"]}

My config:
# Connecting to GMail
input {
imap {
host => "imap.gmail.com"
user => "@gmail.com"
password => "
"
port => 993
secure => true
verify_cert => false
content_type => "text/plain"
tags => ["email", "toto"]
}
}

1 Like

Elastic version 7.4.2

I try different value in content_type but no improvement.
I dont understand the error about #decode explaination

It seems a bug identified but not resolved since 2017:

1 Like

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