Reset UserInfo.current_user_id bevor processing of postmaster filters.

This commit is contained in:
Martin Edenhofer 2016-04-12 17:21:48 +02:00
parent fb25016c8e
commit bb1907415b

View file

@ -346,6 +346,7 @@ retrns
mail = parse(msg)
# run postmaster pre filter
UserInfo.current_user_id = 1
filters = {}
Setting.where(area: 'Postmaster::PreFilter').order(:name).each {|setting|
filters[setting.name] = Kernel.const_get(Setting.get(setting.name))
@ -370,9 +371,6 @@ retrns
# use transaction
ActiveRecord::Base.transaction do
# reset current_user
UserInfo.current_user_id = 1
# create sender if needed
sender_user_id = mail[ 'x-zammad-customer-id'.to_sym ]
if !sender_user_id