From 91ab4aef64c909e89a20884513016ddcc49e4663 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 22 Aug 2016 10:06:33 +0200 Subject: [PATCH] Fixed sender identification. --- app/models/channel/filter/identify_sender.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/channel/filter/identify_sender.rb b/app/models/channel/filter/identify_sender.rb index e2c3a7aed..d6208a9ef 100644 --- a/app/models/channel/filter/identify_sender.rb +++ b/app/models/channel/filter/identify_sender.rb @@ -6,7 +6,7 @@ module Channel::Filter::IdentifySender customer_user_id = mail[ 'x-zammad-customer-id'.to_sym ] customer_user = nil - if customer_user_id + if !customer_user_id.empty? customer_user = User.lookup(id: customer_user_id) if !customer_user Rails.logger.debug "Invalid x-zammad-customer-id header '#{customer_user_id}', no such user." @@ -20,10 +20,10 @@ module Channel::Filter::IdentifySender end # check if sender exists in database - if mail[ 'x-zammad-customer-login'.to_sym ] + if !mail[ 'x-zammad-customer-login'.to_sym ].empty? customer_user = User.find_by(login: mail[ 'x-zammad-customer-login'.to_sym ]) end - if !customer_user + if !customer_user && !mail[ 'x-zammad-customer-email'.to_sym ].empty? customer_user = User.find_by(email: mail[ 'x-zammad-customer-email'.to_sym ]) end if !customer_user