Whitelist GitLab messages in Schleuder list
Schleuder bounces "automated messages" to list admins (upstream bug), but some need to be whitelisted, like the ones coming from GitLab:
X-GitLab-Project: sysadmin
X-GitLab-Project-Id: 3
X-GitLab-Project-Path: tails/sysadmin
X-GitLab-Issue-ID: 48
X-GitLab-Issue-IID: 17693
X-GitLab-NotificationReason:
X-GitLab-Reply-Key: [OMITTED]
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All
Adding a file to /usr/local/lib/schleuder/filters/pre_decryption/01_automated_messages_whitelist.rb
with the following content should do the work:
module Schleuder
module Filters
# Workaround to let some auto-submitted GitLab messages pass through the
# "automated messages" Schleuder filter. We modify the original message by
# setting the 'Auto-Submitted' header to 'no' when certain criteria is
# found.
def self.automated_messages_whitelist(list, mail)
if mail[:auto_submitted] && mail[:auto_submitted].to_s.downcase != 'no' &&
(mail[:x_gitlab_project] && mail[:x_gitlab_project].to_s == 'sysadmins')
mail[:auto_submitted].value = 'no'
end
end
end
end