class ApplicationMailer < ActionMailer::Base
  default from: Rails.application.config.action_mailer.smtp_settings[:from]
  layout 'mailer'
end

class ApplicationMailer < ActionMailer::Base
  # TODO: Remove hard code domain
  default(from: Rails.application.config.action_mailer.smtp_settings[:from],
          "Message-ID" =>"#{Digest::SHA2.hexdigest(Time.now.to_i.to_s)}@noty.im")

  layout 'mailer'
end

Add default message id for spam
Add default message id for spam

http://blog.mailgun.com/tips-tricks-avoiding-gmail-spam-filtering-when-using-ruby-on-rails-action-mailer/
