mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Merge pull request #588 from jdve/fix-imap-multipart
imap: support multipart w/o plaintext part
This commit is contained in:
commit
c8a20fca37
1 changed files with 2 additions and 1 deletions
|
@ -79,7 +79,8 @@ class LogStash::Inputs::IMAP < LogStash::Inputs::Base
|
|||
message = mail.body.decoded
|
||||
else
|
||||
# Multipart message; use the first text/plain part we find
|
||||
message = mail.parts.find { |p| p.content_type =~ /^text\/plain/ }.decoded
|
||||
part = mail.parts.find { |p| p.content_type =~ /^text\/plain/ } || mail.parts.first
|
||||
message = part.decoded
|
||||
end
|
||||
|
||||
event = LogStash::Event.new("message" => message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue