Commit 20888803 authored by Douwe Maan's avatar Douwe Maan

Ignore empty incoming messages.

parent e449426a
...@@ -3,6 +3,8 @@ class EmailRejectionMailer < BaseMailer ...@@ -3,6 +3,8 @@ class EmailRejectionMailer < BaseMailer
@reason = reason @reason = reason
@original_message = Mail::Message.new(original_raw) @original_message = Mail::Message.new(original_raw)
return unless @original_message.from
headers = { headers = {
to: @original_message.from, to: @original_message.from,
subject: "[Rejected] #{@original_message.subject}" subject: "[Rejected] #{@original_message.subject}"
......
...@@ -18,6 +18,8 @@ class EmailReceiverWorker ...@@ -18,6 +18,8 @@ class EmailReceiverWorker
def handle_failure(raw, e) def handle_failure(raw, e)
Rails.logger.warn("Email can not be processed: #{e}\n\n#{raw}") Rails.logger.warn("Email can not be processed: #{e}\n\n#{raw}")
return unless raw.present?
can_retry = false can_retry = false
reason = nil reason = nil
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
# :name: "inbox" # :name: "inbox"
# # Always "sidekiq". # # Always "sidekiq".
# :delivery_method: sidekiq # :delivery_method: sidekiq
# # Always true.
# :delete_after_delivery: true
# :delivery_options: # :delivery_options:
# # The URL to the Redis server used by Sidekiq. Should match the URL in config/resque.yml. # # The URL to the Redis server used by Sidekiq. Should match the URL in config/resque.yml.
# :redis_url: redis://localhost:6379 # :redis_url: redis://localhost:6379
......
...@@ -59,6 +59,8 @@ In this example, we'll use the Gmail address `gitlab-replies@gmail.com`. If you' ...@@ -59,6 +59,8 @@ In this example, we'll use the Gmail address `gitlab-replies@gmail.com`. If you'
:name: "inbox" :name: "inbox"
# Always "sidekiq". # Always "sidekiq".
:delivery_method: sidekiq :delivery_method: sidekiq
# Always true.
:delete_after_delivery: true
:delivery_options: :delivery_options:
# The URL to the Redis server used by Sidekiq. Should match the URL in config/resque.yml. # The URL to the Redis server used by Sidekiq. Should match the URL in config/resque.yml.
:redis_url: redis://localhost:6379 :redis_url: redis://localhost:6379
...@@ -144,6 +146,8 @@ TODO ...@@ -144,6 +146,8 @@ TODO
:name: "inbox" :name: "inbox"
# Always "sidekiq". # Always "sidekiq".
:delivery_method: sidekiq :delivery_method: sidekiq
# Always true.
:delete_after_delivery: true
:delivery_options: :delivery_options:
# The URL to the Redis server used by Sidekiq. Should match the URL in config/resque.yml. # The URL to the Redis server used by Sidekiq. Should match the URL in config/resque.yml.
:redis_url: redis://localhost:6379 :redis_url: redis://localhost:6379
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment