Commit bc6eee11 authored by Nina's avatar Nina

Merge branch 'admin-notifications-add-list-id-header' into 'master'

Add missing List-Id header to notification mails sent to admins

See merge request !312
parents 0a049c0c ee41fd42
Pipeline #33401 passed with stages
in 25 minutes and 28 seconds
......@@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](
* Fixed using x-attach-listkey with emails from Thunderbird that include protected headers.
* Ensure ASCII-8BIT as external encoding, this should ensure that plain text emails in different charsets can be parsed (#409)
* Handle incoming mails encrypted to an absent key, using symmetric encryption or containing PGP-garbage in a more graceful manner: Don't throw an exception, don't notify (and annoy) the admins, instead inform the sender of the mail how to do better. (#337)
* Add missing List-Id header to notification mails sent to admins. This should help with filtering such messages, which is currently not easy to do in a reliable way.
## [3.4.1] / 2019-09-16
......@@ -42,6 +42,8 @@ module Schleuder
gpg_opts.merge!(encrypt: true, keys: { address => key.fingerprint })
mail.gpg gpg_opts
mail.header['List-Id'] = "<#{'@', '.')}>"
......@@ -97,4 +97,16 @@ describe Schleuder::LoggerNotifications do
expect( be(2)
expect( eql('Something')
it 'includes a List-Id header in notification mails sent to admins' do
list = create(:list, send_encrypted_only: false)
list.subscribe("", nil, true)
mail =
list.logger.notify_admin("Something", mail.to_s, I18n.t('notice'))
message = Mail::TestMailer.deliveries.first
expect(message.header['List-Id'].to_s).to eql("<#{'@', '.')}>")
Markdown is supported
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