Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix use of sender_email in mail_handler

Oliver Güntherf95f7e41fd18
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 8e618bab3c9..81bcdc7bfeb 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -36,7 +36,7 @@ class MailHandler < ActionMailer::Base
class MissingInformation < StandardError; end
- attr_reader :email, :user, :options
+ attr_reader :email, :sender_email, :user, :options
##
# Code copied from base class and extended with optional options parameter
@@ -69,7 +69,7 @@ class MailHandler < ActionMailer::Base
# Returns the created object (eg. an issue, a message) or false
def receive(email)
@email = email
- sender_email = email.from.to_a.first.to_s.strip
+ @sender_email = email.from.to_a.first.to_s.strip
# Ignore emails received from the application emission address to avoid hell cycles
if sender_email.downcase == Setting.mail_from.to_s.strip.downcase
log "ignoring email from emission address [#{sender_email}]"