Bug#948991: buster-pu: package schleuder/3.4.0-2+deb10u2

2020-01-27 Thread Georg Faerber
Hi Adam,

On 20-01-24 21:59:41, Adam D. Barratt wrote:
> Please go ahead.

Thanks, that is done, with a small addition to never ask for a
passphrase, in case Schleuder is given a symmetrically encrypted mail.
This was happening sometimes if people were running the test suite.

Cheers,
Georg



Bug#948991: buster-pu: package schleuder/3.4.0-2+deb10u2

2020-01-24 Thread Adam D. Barratt
Control; tags -1 + confirmed

On Wed, 2020-01-15 at 18:01 +, Georg Faerber wrote:
> Schleuder in buster (proposed-updates) is affected by various
> problems, which I would like to fix:
> 
>   - 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. (Closes: #948980)
> 
>   - Handle various exceptions due to decryption problems gracefully:
> 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.
> (Closes: #948981)
>   
>   - Default to ASCII-8BIT encoding for external data:
> This should ensure Schleuder is able to handle incoming mails in
> different character sets. Currently Schleuder may run into a fatal
> error due to "invalid byte sequence in US-ASCII". (Closes: #948982)
> 

Please go ahead.

Regards,

Adam



Bug#948991: buster-pu: package schleuder/3.4.0-2+deb10u2

2020-01-15 Thread Georg Faerber
Package: release.debian.org
Severity: normal
Tags: buster
User: release.debian@packages.debian.org
Usertags: pu

Dear SRMs,

Schleuder in buster (proposed-updates) is affected by various problems, which I
would like to fix:

  - 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. (Closes: #948980)

  - Handle various exceptions due to decryption problems gracefully:
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.
(Closes: #948981)
  
  - Default to ASCII-8BIT encoding for external data:
This should ensure Schleuder is able to handle incoming mails in different
character sets. Currently Schleuder may run into a fatal error due to
"invalid byte sequence in US-ASCII". (Closes: #948982)

The proposed code changes are minimal, targeted, guarded by tests and validated
in production. All of them are fixed in unstable via 3.4.1-2. 

Please find the debdiff between schleuder/3.4.0-2+deb10u1 and
schleuder/3.4.0-2+deb10u2 attached.

Thanks for your work!

Cheers,
Georg
diffstat for schleuder-3.4.0 schleuder-3.4.0

 changelog  |   16 
 patches/0020-admin-notifications-list-id-header.patch  |   41 ++
 patches/0021-handle-decryption-errors-gracefully.patch |  199 +++
 patches/0022-ASCII-8BIT-encoding.patch |  284 +
 patches/series |3 
 5 files changed, 543 insertions(+)

diff -Nru schleuder-3.4.0/debian/changelog schleuder-3.4.0/debian/changelog
--- schleuder-3.4.0/debian/changelog	2019-11-08 10:45:22.0 +
+++ schleuder-3.4.0/debian/changelog	2020-01-15 17:11:59.0 +
@@ -1,3 +1,19 @@
+schleuder (3.4.0-2+deb10u2) buster; urgency=medium
+
+  * debian/patches:
+- Pull in upstream patch to add missing List-Id header to notification
+  mails sent to admins. (Closes: #948980)
+- Pull in upstream patch to handle decryption problems gracefully: 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. (Closes: #948981)
+- Pull in upstream patch to default to ASCII-8BIT encoding. This should
+  ensure Schleuder is able to handle mails with different charsets.
+  (Closes: #948982)
+
+ -- Georg Faerber   Wed, 15 Jan 2020 17:11:59 +
+
 schleuder (3.4.0-2+deb10u1) buster; urgency=medium
 
   * debian/patches:
diff -Nru schleuder-3.4.0/debian/patches/0020-admin-notifications-list-id-header.patch schleuder-3.4.0/debian/patches/0020-admin-notifications-list-id-header.patch
--- schleuder-3.4.0/debian/patches/0020-admin-notifications-list-id-header.patch	1970-01-01 00:00:00.0 +
+++ schleuder-3.4.0/debian/patches/0020-admin-notifications-list-id-header.patch	2020-01-15 17:11:59.0 +
@@ -0,0 +1,41 @@
+Description: admin notifications: add missing List-Id header
+Author: Georg Faerber 
+Origin: upstream
+Forwarded: https://0xacab.org/schleuder/schleuder/merge_requests/312/diffs?commit_id=ee41fd4215bba6bea5aba12806089e9d415c1bd1
+Last-Update: 2020-01-15
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: schleuder/lib/schleuder/logger_notifications.rb
+===
+--- schleuder.orig/lib/schleuder/logger_notifications.rb	2020-01-15 14:43:57.209563572 +
 schleuder/lib/schleuder/logger_notifications.rb	2020-01-15 15:32:09.448514094 +
+@@ -42,6 +42,8 @@
+ gpg_opts.merge!(encrypt: true, keys: { address => key.fingerprint })
+   end
+   mail.gpg gpg_opts
++
++  mail.header['List-Id'] = "<#{@list.email.gsub('@', '.')}>"
+ end
+ mail.deliver
+   end
+Index: schleuder/spec/schleuder/unit/logger_notifications_spec.rb
+===
+--- schleuder.orig/spec/schleuder/unit/logger_notifications_spec.rb	2019-11-03 18:31:21.013704003 +
 schleuder/spec/schleuder/unit/logger_notifications_spec.rb	2020-01-15 15:32:09.448514094 +
+@@ -97,4 +97,16 @@
+ expect(message.parts.size).to be(2)
+ expect(message.parts.first.parts.first.body.to_s).to eql('Something')
+   end
++
++  it 'includes a List-Id header in notification mails sent to admins' do
++list = create(:list, send_encrypted_only: false)
++list.subscribe("schleu...@example.org", nil, true)
++
++mail = Mail.new
++list.logger.notify_admin("Something", mail.to_s, I18n.t('notice'))
++
++message = Mail::Te