Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support folder other than INBOX #921

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/logstash/inputs/imap.rb
Expand Up @@ -20,6 +20,7 @@ class LogStash::Inputs::IMAP < LogStash::Inputs::Base
config :password, :validate => :password, :required => true
config :secure, :validate => :boolean, :default => true

config :folder, :validate => :string, :default => 'INBOX'
config :fetch_count, :validate => :number, :default => 50
config :lowercase_headers, :validate => :boolean, :default => true
config :check_interval, :validate => :number, :default => 300
Expand Down Expand Up @@ -61,7 +62,7 @@ def check_mail(queue)
# TODO(sissel): handle exceptions happening during runtime:
# EOFError, OpenSSL::SSL::SSLError
imap = connect
imap.select("INBOX")
imap.select(@folder)
ids = imap.search("NOT SEEN")

ids.each_slice(@fetch_count) do |id_set|
Expand Down