:mailboxes:
<%
require '/opt/gitlab/embedded/service/gitlab-rails/config/environment.rb'

if Gitlab::IncomingEmail.enabled? 
  config = Gitlab::IncomingEmail.config

  redis_config_file = "/opt/gitlab/embedded/service/gitlab-rails/config/resque.yml"
  redis_url = 
    if File.exists?(redis_config_file)
      YAML.load_file(redis_config_file)[Rails.env]
    else
      "redis://localhost:6379"
    end
  %>
  -
    :host: <%= config.host.to_json %>
    :port: <%= config.port.to_json %>
    :ssl: <%= config.ssl.to_json %>
    :start_tls: <%= config.start_tls.to_json %>
    :email: <%= config.user.to_json %>
    :password: <%= config.password.to_json %>

    :name: <%= config.mailbox.to_json %>

    :delete_after_delivery: true

    :delivery_method: sidekiq
    :delivery_options:
      :redis_url: <%= redis_url.to_json %>
      :namespace: resque:gitlab
      :queue: incoming_email
      :worker: EmailReceiverWorker

    :arbitration_method: redis
    :arbitration_options:
      :redis_url: <%= redis_url.to_json %>
      :namespace: mail_room:gitlab
<% end %>

:mailboxes:
<%
require '/opt/gitlab/embedded/service/gitlab-rails/config/environment.rb'

if Gitlab::IncomingEmail.enabled? 
  config = Gitlab::IncomingEmail.config

  redis_config_file = "/opt/gitlab/embedded/service/gitlab-rails/config/resque.yml"
  redis_url = 
    if File.exists?(redis_config_file)
      YAML.load_file(redis_config_file)[Rails.env]
    else
      "redis://localhost:6379"
    end
  %>
  -
    :host: <%= config.host.to_json %>
    :port: <%= config.port.to_json %>
    :ssl: <%= config.ssl.to_json %>
    :start_tls: <%= config.start_tls.to_json %>
    :email: <%= config.user.to_json %>
    :password: <%= config.password.to_json %>
    :idle_timeout: 60

    :name: <%= config.mailbox.to_json %>

    :delete_after_delivery: true

    :delivery_method: sidekiq
    :delivery_options:
      :redis_url: <%= redis_url.to_json %>
      :namespace: resque:gitlab
      :queue: incoming_email
      :worker: EmailReceiverWorker

    :arbitration_method: redis
    :arbitration_options:
      :redis_url: <%= redis_url.to_json %>
      :namespace: mail_room:gitlab
<% end %>

Change the default imap idle timeout of 29 minutes to 60 seconds
Change the default imap idle timeout of 29 minutes to 60 seconds
