schleuder 4.0.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f8275838177195ab78283d9c737de9cbd2d39e816c9f41db2e31d785d787dd8
4
- data.tar.gz: 464e220965c5d0ee43d300a1f988e7a27edd9344d751bae9e06a9a02fc5c2a43
3
+ metadata.gz: c44b12c722680d91cee45a80ae2ee6a4ff47a9544dfd171cc83a5549bdd72be2
4
+ data.tar.gz: 77773ef59d05b1faff86cf2fe5d22ef657cd5683e6184db1a55b28d1592b07d2
5
5
  SHA512:
6
- metadata.gz: d6ba6aab5c19ae0f8f74a0fe44e84e5a10f4adf434f55454a1d7ca49943557fbad5db23ff06fee1a3e0efa5a248034f8a6a17dcbeb91864bf04ec68f8cd14d1f
7
- data.tar.gz: bd361a32b63c6bcfa146e1369a45fa54e9c3c94d29baaefbbff01a1629b468c896a34c17cd6ff957357eaf67611a5b09b5c2b2d9a023130430a86f29892b19cb
6
+ metadata.gz: eb351c776f1773cf0dd5ef0f04f310fe70a0155d9344fd75eb78fce9b0d69cad0f0d9bfad664d1a8ab004a55c2d29a849cf1ea2cd0a295c61c3b56b96a25d9a8
7
+ data.tar.gz: 97ab8283c694fac04196ee752ffe3153f57acb1e37c8754c8c9f1840fbf5109d47fac3426aa8fa3f168341efbfcf38c8d4292e9a360b3d81dff5d9231ac9b700
data/README.md CHANGED
@@ -36,15 +36,15 @@ Additionally these **rubygems** are required (will be installed automatically un
36
36
  Installing Schleuder
37
37
  ------------
38
38
 
39
- 1. Download [the gem](https://schleuder.org/download/schleuder-4.0.2.gem) and [the OpenPGP-signature](https://schleuder.org/download/schleuder-4.0.2.gem.sig) and verify:
39
+ 1. Download [the gem](https://schleuder.org/download/schleuder-4.0.3.gem) and [the OpenPGP-signature](https://schleuder.org/download/schleuder-4.0.3.gem.sig) and verify:
40
40
  ```
41
41
  gpg --recv-key 0xB3D190D5235C74E1907EACFE898F2C91E2E6E1F3
42
- gpg --verify schleuder-4.0.2.gem.sig
42
+ gpg --verify schleuder-4.0.3.gem.sig
43
43
  ```
44
44
 
45
45
  2. If all went well install the gem:
46
46
  ```
47
- gem install schleuder-4.0.2.gem
47
+ gem install schleuder-4.0.3.gem
48
48
  ```
49
49
 
50
50
  3. Set up schleuder:
@@ -134,4 +134,4 @@ GNU GPL 3.0. Please see [LICENSE.txt](LICENSE.txt).
134
134
  Alternative Download
135
135
  --------------------
136
136
 
137
- Alternatively to the gem-files you can download the latest release as [a tarball](https://schleuder.org/download/schleuder-4.0.2.tar.gz) and [its OpenPGP-signature](https://schleuder.org/download/schleuder-4.0.2.tar.gz.sig).
137
+ Alternatively to the gem-files you can download the latest release as [a tarball](https://schleuder.org/download/schleuder-4.0.3.tar.gz) and [its OpenPGP-signature](https://schleuder.org/download/schleuder-4.0.3.tar.gz.sig).
@@ -0,0 +1,46 @@
1
+ # Since ActiveRecord >= 6.0, the SQLite3 connection adapter relies on boolean
2
+ # serialization to use 1 and 0, but does not natively recognize 't' and 'f' as
3
+ # booleans were previously serialized.
4
+ #
5
+ # Accordingly, this migration handles conversion of both column defaults and
6
+ # stored data provided by a user.
7
+ #
8
+ # In contrast to other migrations, only a 'forward' method is provided, a
9
+ # mechanism to 'reverse' is not. Given the nature of this migration, the later
10
+ # is not really required.
11
+ #
12
+ # Unfortunately, we missed this breaking change when bumping ActiveRecord to >=
13
+ # 6.0 in Schleuder version 4.0. This caused quite some work upstream, but also
14
+ # in downstream environments and, last but not least, at the side of users.
15
+ #
16
+ # We should extend our CI to explicitly test, and ensure things work as
17
+ # expected, if running a Schleuder setup in real world. As of now, we don't
18
+ # ensure data provided by a user in Schleuder version x still works after
19
+ # upgrading to version y.
20
+
21
+ class ChangeBooleanValuesToIntegers < ActiveRecord::Migration[6.0]
22
+ class Lists < ActiveRecord::Base
23
+ end
24
+
25
+ class Subscriptions < ActiveRecord::Base
26
+ end
27
+
28
+ def up
29
+ [Lists, Subscriptions].each do |table|
30
+ unless table.connection.is_a?(ActiveRecord::ConnectionAdapters::SQLite3Adapter)
31
+ return
32
+ end
33
+
34
+ bool_columns_defaults = table.columns.select { |column| column.type == :boolean }.map{ |column| [column.name, column.default] }
35
+
36
+ bool_columns_defaults.each do |column_name, column_default|
37
+ column_bool = ActiveRecord::Type::Boolean.new.deserialize(column_default)
38
+
39
+ change_column_default :"#{table.table_name}", :"#{column_name}", column_bool
40
+
41
+ table.where("#{column_name} = 'f'").update_all("#{column_name}": 0)
42
+ table.where("#{column_name} = 't'").update_all("#{column_name}": 1)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,28 @@
1
+ # It seems, the change to ActiveRecord >= 6.0 makes this necessary.
2
+ # Without doing this, the auto-generated database schema file would drop
3
+ # these limits, if running migrations.
4
+ #
5
+ # In contrast to other migrations, only a 'forward' method is provided, a
6
+ # mechanism to 'reverse' is not. Given the nature of this migration, the later
7
+ # is not really required.
8
+ #
9
+ # This has been an upstream issue for quite some time. For details, see
10
+ # https://github.com/rails/rails/issues/19001.
11
+
12
+ class AddLimitsToStringColumns < ActiveRecord::Migration[6.0]
13
+ class Lists < ActiveRecord::Base
14
+ end
15
+
16
+ class Subscriptions < ActiveRecord::Base
17
+ end
18
+
19
+ def up
20
+ [Lists, Subscriptions].each do |table|
21
+ string_columns = table.columns.select { |column| column.type == :string }.map(&:name)
22
+
23
+ string_columns.each do |column_name|
24
+ change_column :"#{table.table_name}", :"#{column_name}", :string, :limit => 255
25
+ end
26
+ end
27
+ end
28
+ end
data/db/schema.rb CHANGED
@@ -10,18 +10,18 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2020_01_18_170110) do
13
+ ActiveRecord::Schema.define(version: 2021_11_07_151309) do
14
14
 
15
15
  create_table "lists", force: :cascade do |t|
16
16
  t.datetime "created_at"
17
17
  t.datetime "updated_at"
18
- t.string "email"
19
- t.string "fingerprint"
20
- t.string "log_level", default: "warn"
21
- t.string "subject_prefix", default: ""
22
- t.string "subject_prefix_in", default: ""
23
- t.string "subject_prefix_out", default: ""
24
- t.string "openpgp_header_preference", default: "signencrypt"
18
+ t.string "email", limit: 255
19
+ t.string "fingerprint", limit: 255
20
+ t.string "log_level", limit: 255, default: "warn"
21
+ t.string "subject_prefix", limit: 255, default: ""
22
+ t.string "subject_prefix_in", limit: 255, default: ""
23
+ t.string "subject_prefix_out", limit: 255, default: ""
24
+ t.string "openpgp_header_preference", limit: 255, default: "signencrypt"
25
25
  t.text "public_footer", default: ""
26
26
  t.text "headers_to_meta", default: "[\"from\", \"to\", \"cc\", \"date\", \"sig\", \"enc\"]"
27
27
  t.text "bounces_drop_on_headers", default: "{\"x-spam-flag\":\"yes\"}"
@@ -39,7 +39,7 @@ ActiveRecord::Schema.define(version: 2020_01_18_170110) do
39
39
  t.boolean "include_list_headers", default: true
40
40
  t.boolean "include_openpgp_header", default: true
41
41
  t.integer "max_message_size_kb", default: 10240
42
- t.string "language", default: "en"
42
+ t.string "language", limit: 255, default: "en"
43
43
  t.boolean "forward_all_incoming_to_admins", default: false
44
44
  t.integer "logfiles_to_keep", default: 2
45
45
  t.text "internal_footer", default: ""
@@ -51,8 +51,8 @@ ActiveRecord::Schema.define(version: 2020_01_18_170110) do
51
51
 
52
52
  create_table "subscriptions", force: :cascade do |t|
53
53
  t.integer "list_id"
54
- t.string "email"
55
- t.string "fingerprint"
54
+ t.string "email", limit: 255
55
+ t.string "fingerprint", limit: 255
56
56
  t.boolean "admin", default: false
57
57
  t.boolean "delivery_enabled", default: true
58
58
  t.datetime "created_at"
data/lib/schleuder/cli.rb CHANGED
@@ -132,7 +132,7 @@ module Schleuder
132
132
  def shellexec(cmd)
133
133
  result = `#{cmd} 2>&1`
134
134
  if $?.exitstatus > 0
135
- exit $?.exitstatus
135
+ fatal result, $?.exitstatus
136
136
  end
137
137
  result
138
138
  end
@@ -13,11 +13,7 @@ module Schleuder
13
13
  list.logger.debug "Calling filter #{cmd}"
14
14
  response = Filters.send(cmd, list, mail)
15
15
  if stop?(response)
16
- if bounce?(response, mail)
17
- return response
18
- else
19
- return nil
20
- end
16
+ return response
21
17
  end
22
18
  end
23
19
  nil
@@ -32,31 +28,6 @@ module Schleuder
32
28
  response.kind_of?(StandardError)
33
29
  end
34
30
 
35
- def bounce?(response, mail)
36
- if list.bounces_drop_all
37
- list.logger.debug 'Dropping bounce as configurated'
38
- notify_admins(I18n.t('.bounces_drop_all'), mail.original_message)
39
- return false
40
- end
41
-
42
- list.bounces_drop_on_headers.each do |key, value|
43
- if mail[key].to_s.match(/#{value}/i)
44
- list.logger.debug "Incoming message header key '#{key}' matches value '#{value}': dropping the bounce."
45
- notify_admins(I18n.t('.bounces_drop_on_headers', key: key, value: value), mail.original_message)
46
- return false
47
- end
48
- end
49
-
50
- list.logger.debug 'Bouncing message'
51
- true
52
- end
53
-
54
- def notify_admins(reason, original_message)
55
- if list.bounces_notify_admins?
56
- list.logger.notify_admin reason, original_message, I18n.t('notice')
57
- end
58
- end
59
-
60
31
  def load_filters
61
32
  list.logger.debug "Loading #{filter_type}_decryption filters"
62
33
  sorted_filters.map do |filter_name|
@@ -31,7 +31,13 @@ module Schleuder
31
31
  end
32
32
 
33
33
  error = run_filters('pre')
34
- return error if error
34
+ if error
35
+ if bounce?(error, @mail)
36
+ return error
37
+ else
38
+ return nil
39
+ end
40
+ end
35
41
 
36
42
  begin
37
43
  # This decrypts, verifies, etc.
@@ -48,7 +54,13 @@ module Schleuder
48
54
  end
49
55
 
50
56
  error = run_filters('post')
51
- return error if error
57
+ if error
58
+ if bounce?(error, @mail)
59
+ return error
60
+ else
61
+ return nil
62
+ end
63
+ end
52
64
 
53
65
  if ! @mail.was_validly_signed?
54
66
  logger.debug 'Message was not validly signed, adding subject_prefix_in'
@@ -85,16 +97,34 @@ module Schleuder
85
97
  @list
86
98
  end
87
99
 
88
- def run_filters(filter_type)
89
- error = filters_runner(filter_type).run(@mail)
90
- if error
91
- if list.bounces_notify_admins?
92
- text = "#{I18n.t('.bounces_notify_admins')}\n\n#{error}"
93
- # TODO: raw_source is mostly blank?
94
- logger.notify_admin text, @mail.original_message, I18n.t('notice')
100
+ def notify_admins(reason, original_message)
101
+ if list.bounces_notify_admins
102
+ list.logger.notify_admin reason, original_message, I18n.t('notice')
103
+ end
104
+ end
105
+
106
+ def bounce?(response, mail)
107
+ if list.bounces_drop_all
108
+ list.logger.debug 'Dropping bounce as configurated'
109
+ notify_admins(I18n.t('.bounces_drop_all'), mail.original_message)
110
+ return false
111
+ end
112
+
113
+ list.bounces_drop_on_headers.each do |key, value|
114
+ if mail[key].to_s.match(/#{value}/i)
115
+ list.logger.debug "Incoming message header key '#{key}' matches value '#{value}': dropping the bounce."
116
+ notify_admins(I18n.t('.bounces_drop_on_headers', key: key, value: value), mail.original_message)
117
+ return false
95
118
  end
96
- return error
97
119
  end
120
+
121
+ list.logger.debug 'Bouncing message'
122
+ notify_admins("#{I18n.t('.bounces_notify_admins')}\n\n#{response}", mail.original_message)
123
+ true
124
+ end
125
+
126
+ def run_filters(filter_type)
127
+ filters_runner(filter_type).run(@mail)
98
128
  end
99
129
 
100
130
  def filters_runner(filter_type)
@@ -1,3 +1,3 @@
1
1
  module Schleuder
2
- VERSION = '4.0.2'
2
+ VERSION = '4.0.3'
3
3
  end
data/locales/de.yml CHANGED
@@ -11,12 +11,12 @@ de:
11
11
  invalid: "enthält nicht druckbare Zeichen"
12
12
  public_footer:
13
13
  invalid: "enthält nicht druckbare Zeichen"
14
- invalid_email: "ist keine valide E-Mail-Adresse"
15
- invalid_fingerprint: "ist kein valider OpenPGP-Fingerabdruck"
16
- list_fingerprint_missing: "Fingerabdruck der Liste ist nicht gesetzt, kann nicht arbeiten! (In `%{listdir}`.)"
17
- list_key_missing: "Schlüssel der Liste nicht im Schlüsselring gefunden, kann nicht arbeiten! (In `%{listdir}`.)"
18
- list_secret_key_missing: "Geheimer Schlüssel der Liste nicht im Schlüsselring gefunden, kann nicht arbeiten! (In `%{listdir}`.)"
19
- list_admins_missing: "List hat keine Admins konfiguriert, kann nicht arbeiten! (In `%{listdir}`.)"
14
+ invalid_email: "ist keine gültige E-Mail-Adresse"
15
+ invalid_fingerprint: "ist kein gültiger OpenPGP-Fingerabdruck"
16
+ list_fingerprint_missing: "Fingerabdruck der Liste ist nicht gesetzt, kann nicht verarbeiten! (In `%{listdir}`.)"
17
+ list_key_missing: "Schlüssel der Liste nicht im Schlüsselring gefunden, kann nicht verarbeiten! (In `%{listdir}`.)"
18
+ list_secret_key_missing: "Geheimer Schlüssel der Liste nicht im Schlüsselring gefunden, kann nicht verarbeiten! (In `%{listdir}`.)"
19
+ list_admins_missing: "List hat keine Admins konfiguriert, kann nicht verarbeiten! (In `%{listdir}`.)"
20
20
  fatalerror: |
21
21
  Es ist ein schwerwiegender Fehler aufgetreten. Administratoren wurden benachrichtigt.
22
22
  Bitte versuche es später noch ein Mal.
@@ -37,7 +37,7 @@ de:
37
37
  message_signature_unknown: |
38
38
  Emails an diese Adresse müssen mit dem OpenPGP-Schlüssel signiert sein, der
39
39
  deiner Mitgliedschaft zugewiesen ist. Wenn du nicht weisst, welcher Schlüssel das ist, frage
40
- die Administrator/innen. Die erreichst du per Email an
40
+ die Administrator/innen. Diese erreichst du per Email an
41
41
  <%{owner_email}>.
42
42
  (Vorzugsweise verschlüssele die Email mit dem Schlüssel dieser Adresse:
43
43
  %{list_fingerprint}).
@@ -147,7 +147,7 @@ de:
147
147
  Mitgliedschaft von %{email} nicht gelöscht:
148
148
  %{errors}
149
149
  cannot_unsubscribe_last_admin: |
150
- %{email} ist die einzige admin-Mitgliedschaft für diese Liste, daher darf sie nicht gelöscht werden.
150
+ %{email} ist die einzige Admin-Mitgliedschaft für diese Liste, daher darf sie nicht gelöscht werden.
151
151
  subscribed: |
152
152
  Mitgliedschaft von %{email} mit diesen Werten eingetragen:
153
153
 
@@ -159,7 +159,7 @@ de:
159
159
 
160
160
  %{errors}.
161
161
  list_of_subscriptions: "Mitgliedschaften:\n"
162
- set_fingerprint_only_self: Nur admins dürfen den Fingerabdruck für andere Mitgliedschaften festlegen.
162
+ set_fingerprint_only_self: Nur Admins dürfen den Fingerabdruck für andere Mitgliedschaften festlegen.
163
163
  fingerprint_set: Fingerabdruck für %{email} auf %{fingerprint} gesetzt.
164
164
  setting_fingerprint_failed: |
165
165
  Fingerabdruck für %{email} konnte nicht auf %{fingerprint} gesetzt werden:
@@ -172,7 +172,7 @@ de:
172
172
  Benötigt werden ein oder zwei Werte, bspw.:
173
173
  X-SET-FINGERPRINT: 0xB3D190D5235C74E1907EACFE898F2C91E2E6E1F3
174
174
 
175
- oder (als admin):
175
+ oder (als Admin):
176
176
  X-SET-FINGERPRINT: subscription2@hostname 0xB3D190D5235C74E1907EACFE898F2C91E2E6E1F3
177
177
 
178
178
  Wobei der Fingerprint in der gesamten Länge (40 Zeichen) angegeben werden muss. Optional mit 0x als Präfix.
@@ -184,11 +184,11 @@ de:
184
184
  Benötigt werden ein oder zwei Werte, bspw.:
185
185
  X-SET-FINGERPRINT: 0xB3D190D5235C74E1907EACFE898F2C91E2E6E1F3
186
186
 
187
- oder (als admin):
187
+ oder (als Admin):
188
188
  X-SET-FINGERPRINT: subscription2@hostname 0xB3D190D5235C74E1907EACFE898F2C91E2E6E1F3
189
189
 
190
190
  Um einen Fingerprint zu entfernen kannst du das Schlüsselwort 'UNSET-FINGERPRINT' verwenden.
191
- unset_fingerprint_only_self: Nur admins dürfen den Fingerabdruck für andere Mitgliedschaften löschen.
191
+ unset_fingerprint_only_self: Nur Admins dürfen den Fingerabdruck für andere Mitgliedschaften löschen.
192
192
  fingerprint_unset: Fingerabdruck für %{email} wurde entfernt.
193
193
  unsetting_fingerprint_failed: |
194
194
  Fingerabdruck für %{email} konnte nicht entfernt werden:
@@ -199,7 +199,7 @@ de:
199
199
  Benötigt werden ein Wert, bspw.:
200
200
  X-UNSET-FINGERPRINT: subscription2@hostname
201
201
 
202
- Als admin musst du um deinen eigenen Fingerabdruck zu entfernen, noch zusätzlich das Argument force mitgeben. bspw.:
202
+ Als Admin musst du um deinen eigenen Fingerabdruck zu entfernen, noch zusätzlich das Argument force mitgeben. bspw.:
203
203
  X-UNSET-FINGERPRINT: adminsubscription2@hostname force
204
204
  subscribe_requires_arguments: |
205
205
  Fehler: Du hast zu dem Schlüsselwort 'SUBSCRIBE' keinen Wert angegeben.
@@ -210,13 +210,13 @@ de:
210
210
  Oder, um den Schlüssel der neuen Mitgliedschaft zuzuweisen:
211
211
  X-SUBSCRIBE: new-subscription@hostname 0xB3D190D5235C74E1907EACFE898F2C91E2E6E1F3
212
212
 
213
- Oder, um den Schlüssel zuzuweisen, und die Mitgliedschaft als admin einzutragen:
213
+ Oder, um den Schlüssel zuzuweisen, und die Mitgliedschaft als Admin einzutragen:
214
214
  X-SUBSCRIBE: new-subscription@hostname 0xB3D190D5235C74E1907EACFE898F2C91E2E6E1F3 true
215
215
 
216
- Oder, um den Schlüssel zuzuweisen, die Mitgliedschaft als admin einzutragen, und die Zustellung von Listen-Emails für diese Mitgliedschaft abzuschalten:
216
+ Oder, um den Schlüssel zuzuweisen, die Mitgliedschaft als Admin einzutragen, und die Zustellung von Listen-Emails für diese Mitgliedschaft abzuschalten:
217
217
  X-SUBSCRIBE: new-subscription@hostname 0xB3D190D5235C74E1907EACFE898F2C91E2E6E1F3 true false
218
218
 
219
- Wenn du die optionalen Werte weglässt hat die Mitgliedschaft keinen Schlüssel zugewiesen, ist nicht admin, und hat die Zustellung von Listen-Email aktiviert.
219
+ Wenn du die optionalen Werte weglässt hat die Mitgliedschaft keinen Schlüssel zugewiesen, ist nicht Admin, und hat die Zustellung von Listen-Email aktiviert.
220
220
  sign_this:
221
221
  signatures_attached: Die Signaturen hängen an.
222
222
  no_content_found: Deine Email enthielt keine Anhänge und keinen Text-Inhalt, daher konnte nichts signiert werden.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schleuder
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - schleuder dev team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-31 00:00:00.000000000 Z
11
+ date: 2022-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -240,20 +240,6 @@ dependencies:
240
240
  - - "~>"
241
241
  - !ruby/object:Gem::Version
242
242
  version: '0'
243
- - !ruby/object:Gem::Dependency
244
- name: irb
245
- requirement: !ruby/object:Gem::Requirement
246
- requirements:
247
- - - ">="
248
- - !ruby/object:Gem::Version
249
- version: '0'
250
- type: :development
251
- prerelease: false
252
- version_requirements: !ruby/object:Gem::Requirement
253
- requirements:
254
- - - ">="
255
- - !ruby/object:Gem::Version
256
- version: '0'
257
243
  - !ruby/object:Gem::Dependency
258
244
  name: rack-test
259
245
  requirement: !ruby/object:Gem::Requirement
@@ -341,6 +327,8 @@ files:
341
327
  - db/migrate/20180723173900_add_deliver_selfsent_to_list.rb
342
328
  - db/migrate/20190906194820_add_autocrypt_header_to_list.rb
343
329
  - db/migrate/20200118170110_add_set_reply_to_to_sender_and_munge_from.rb
330
+ - db/migrate/20211106112020_change_boolean_values_to_integers.rb
331
+ - db/migrate/20211107151309_add_limits_to_string_columns.rb
344
332
  - db/schema.rb
345
333
  - etc/init.d/schleuder-api-daemon
346
334
  - etc/list-defaults.yml
@@ -460,8 +448,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
460
448
  - !ruby/object:Gem::Version
461
449
  version: '0'
462
450
  requirements: []
463
- rubygems_version: 3.2.21
464
- signing_key:
451
+ rubyforge_project:
452
+ rubygems_version: 2.7.6.2
453
+ signing_key:
465
454
  specification_version: 4
466
455
  summary: Schleuder is an encrypting mailing list manager with remailing-capabilities.
467
456
  test_files: []