Commit 3b03aeeb authored by Zen Fu's avatar Zen Fu
Browse files

Schleuder: whitelist messages from GitLab (#17714)

parent 47da22ba
module Schleuder
module Filters
# Schleuder filters automated messages, but we want to accept the ones
# coming from GitLab. For this, the ugly workaround is to modify the
# original message and set the 'Auto-Submitted' header to 'no' when certain
# criteria is found.
#
# See: https://gitlab.tails.boum.org/tails/sysadmin/-/issues/17714
def self.automated_messages_whitelist(list, mail)
if mail[:auto_submitted] && mail[:auto_submitted].to_s.downcase != 'no' && mail[:x_gitlab_project]
mail[:auto_submitted].value = 'no'
end
end
end
end
......@@ -101,4 +101,25 @@ class tails::schleuder (
}
}
### Whitelist for automated messages
$filters_dir = '/usr/local/lib/schleuder/filters'
file { "${filters_dir}/pre_decryption":
ensure => directory,
owner => 'root',
group => 'staff',
mode => '0755',
}
file { "${filters_dir}/pre_decryption/01_automated_messages_whitelist.rb":
ensure => present,
source => 'puppet:///modules/tails/schleuder/01_automated_messages_whitelist.rb',
owner => 'root',
group => 'staff',
mode => '0644',
require => File["${filters_dir}/pre_decryption"],
notify => Service['schleuder-api-daemon'],
}
}
Supports Markdown
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