schleuder 3.2.2 → 3.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -11
  3. data/Rakefile +18 -10
  4. data/bin/schleuder +2 -1
  5. data/bin/schleuder-api-daemon +3 -2
  6. data/db/migrate/20180110203100_add_sig_enc_to_headers_to_meta_defaults.rb +30 -0
  7. data/db/migrate/20180723173900_add_deliver_selfsent_to_list.rb +11 -0
  8. data/db/migrate/20190906194820_add_autocrypt_header_to_list.rb +11 -0
  9. data/db/schema.rb +4 -2
  10. data/etc/list-defaults.yml +13 -3
  11. data/etc/schleuder.yml +11 -0
  12. data/lib/schleuder-api-daemon.rb +9 -354
  13. data/lib/schleuder-api-daemon/helpers/schleuder-api-daemon-helper.rb +143 -0
  14. data/lib/schleuder-api-daemon/routes/key.rb +40 -0
  15. data/lib/schleuder-api-daemon/routes/list.rb +69 -0
  16. data/lib/schleuder-api-daemon/routes/status.rb +5 -0
  17. data/lib/schleuder-api-daemon/routes/subscription.rb +99 -0
  18. data/lib/schleuder-api-daemon/routes/version.rb +5 -0
  19. data/lib/schleuder.rb +12 -3
  20. data/lib/schleuder/cli.rb +33 -3
  21. data/lib/schleuder/cli/subcommand_fix.rb +1 -1
  22. data/lib/schleuder/conf.rb +7 -1
  23. data/lib/schleuder/errors/active_model_error.rb +2 -5
  24. data/lib/schleuder/errors/decryption_failed.rb +2 -7
  25. data/lib/schleuder/errors/key_adduid_failed.rb +1 -5
  26. data/lib/schleuder/errors/key_generation_failed.rb +1 -8
  27. data/lib/schleuder/errors/keyword_admin_only.rb +1 -5
  28. data/lib/schleuder/errors/list_not_found.rb +1 -5
  29. data/lib/schleuder/errors/listdir_problem.rb +2 -7
  30. data/lib/schleuder/errors/loading_list_settings_failed.rb +2 -5
  31. data/lib/schleuder/errors/message_empty.rb +1 -5
  32. data/lib/schleuder/errors/message_not_from_admin.rb +2 -5
  33. data/lib/schleuder/errors/message_sender_not_subscribed.rb +2 -5
  34. data/lib/schleuder/errors/message_too_big.rb +2 -5
  35. data/lib/schleuder/errors/message_unauthenticated.rb +1 -4
  36. data/lib/schleuder/errors/message_unencrypted.rb +2 -5
  37. data/lib/schleuder/errors/message_unsigned.rb +2 -5
  38. data/lib/schleuder/errors/too_many_keys.rb +1 -8
  39. data/lib/schleuder/filters/{request_filter.rb → post_decryption/10_request.rb} +0 -0
  40. data/lib/schleuder/filters/{max_message_size.rb → post_decryption/20_max_message_size.rb} +0 -0
  41. data/lib/schleuder/filters/{forward_filter.rb → post_decryption/30_forward_to_owner.rb} +0 -0
  42. data/lib/schleuder/filters/post_decryption/40_receive_admin_only.rb +10 -0
  43. data/lib/schleuder/filters/post_decryption/50_receive_authenticated_only.rb +10 -0
  44. data/lib/schleuder/filters/post_decryption/60_receive_signed_only.rb +10 -0
  45. data/lib/schleuder/filters/post_decryption/70_receive_encrypted_only.rb +10 -0
  46. data/lib/schleuder/filters/post_decryption/80_receive_from_subscribed_emailaddresses_only.rb +10 -0
  47. data/lib/schleuder/filters/post_decryption/90_strip_html_from_alternative_if_keywords_present.rb +21 -0
  48. data/lib/schleuder/filters/{bounces_filter.rb → pre_decryption/10_forward_bounce_to_admins.rb} +0 -0
  49. data/lib/schleuder/filters/{forward_incoming.rb → pre_decryption/20_forward_all_incoming_to_admins.rb} +0 -0
  50. data/lib/schleuder/filters/{send_key_filter.rb → pre_decryption/30_send_key.rb} +0 -0
  51. data/lib/schleuder/filters/{hotmail_message_filter.rb → pre_decryption/40_fix_exchange_messages.rb} +5 -3
  52. data/lib/schleuder/filters/{strip_alternative_filter.rb → pre_decryption/50_strip_html_from_alternative.rb} +1 -1
  53. data/lib/schleuder/filters_runner.rb +41 -31
  54. data/lib/schleuder/gpgme/ctx.rb +24 -3
  55. data/lib/schleuder/gpgme/import_status.rb +13 -7
  56. data/lib/schleuder/gpgme/key.rb +8 -0
  57. data/lib/schleuder/list.rb +26 -4
  58. data/lib/schleuder/logger_notifications.rb +8 -1
  59. data/lib/schleuder/mail/encrypted_part.rb +14 -0
  60. data/lib/schleuder/mail/gpg.rb +15 -0
  61. data/lib/schleuder/mail/message.rb +97 -49
  62. data/lib/schleuder/plugins/attach_listkey.rb +6 -10
  63. data/lib/schleuder/plugins/key_management.rb +34 -26
  64. data/lib/schleuder/plugins/resend.rb +14 -11
  65. data/lib/schleuder/plugins/subscription_management.rb +70 -3
  66. data/lib/schleuder/runner.rb +49 -10
  67. data/lib/schleuder/subscription.rb +5 -9
  68. data/lib/schleuder/validators/fingerprint_validator.rb +1 -1
  69. data/lib/schleuder/version.rb +1 -1
  70. data/locales/de.yml +101 -9
  71. data/locales/en.yml +107 -11
  72. metadata +72 -34
  73. data/lib/schleuder/errors/file_not_found.rb +0 -14
  74. data/lib/schleuder/errors/invalid_listname.rb +0 -13
  75. data/lib/schleuder/errors/list_exists.rb +0 -13
  76. data/lib/schleuder/errors/unknown_list_option.rb +0 -14
  77. data/lib/schleuder/filters/auth_filter.rb +0 -39
@@ -1,14 +0,0 @@
1
- module Schleuder
2
- module Errors
3
- class FileNotFound < Base
4
- def initialize(file)
5
- @file = file
6
- end
7
-
8
- def message
9
- t('errors.file_not_found', file: @file)
10
- end
11
- end
12
- end
13
- end
14
-
@@ -1,13 +0,0 @@
1
- module Schleuder
2
- module Errors
3
- class InvalidListname < Base
4
- def initialize(listname)
5
- @listname = listname
6
- end
7
-
8
- def message
9
- t('errors.invalid_listname', email: @listname)
10
- end
11
- end
12
- end
13
- end
@@ -1,13 +0,0 @@
1
- module Schleuder
2
- module Errors
3
- class ListExists < Base
4
- def initialize(listname)
5
- @listname = listname
6
- end
7
-
8
- def message
9
- t('errors.list_exists', email: @listname)
10
- end
11
- end
12
- end
13
- end
@@ -1,14 +0,0 @@
1
- module Schleuder
2
- module Errors
3
- class UnknownListOption < Base
4
- def initialize(exception)
5
- @option = exception.attribute
6
- @config_file = ENV['SCHLEUDER_LIST_DEFAULTS']
7
- end
8
-
9
- def message
10
- t('errors.unknown_list_option', option: @option, config_file: @config_file)
11
- end
12
- end
13
- end
14
- end
@@ -1,39 +0,0 @@
1
- module Schleuder
2
- module Filters
3
-
4
- def self.receive_encrypted_only(list, mail)
5
- if list.receive_encrypted_only? && ! mail.was_encrypted?
6
- list.logger.info "Rejecting mail as unencrypted"
7
- return Errors::MessageUnencrypted.new(list)
8
- end
9
- end
10
-
11
- def self.receive_signed_only(list, mail)
12
- if list.receive_signed_only? && ! mail.was_validly_signed?
13
- list.logger.info "Rejecting mail as unsigned"
14
- return Errors::MessageUnsigned.new(list)
15
- end
16
- end
17
-
18
- def self.receive_authenticated_only(list, mail)
19
- if list.receive_authenticated_only? && ( ! mail.was_encrypted? || ! mail.was_validly_signed? )
20
- list.logger.info "Rejecting mail as unauthenticated"
21
- return Errors::MessageUnauthenticated.new
22
- end
23
- end
24
-
25
- def self.receive_from_subscribed_emailaddresses_only(list, mail)
26
- if list.receive_from_subscribed_emailaddresses_only? && list.subscriptions.where(email: mail.from.first).blank?
27
- list.logger.info "Rejecting mail as not from subscribed address."
28
- return Errors::MessageSenderNotSubscribed.new(list)
29
- end
30
- end
31
-
32
- def self.receive_admin_only(list, mail)
33
- if list.receive_admin_only? && ( ! mail.was_validly_signed? || ! mail.signer.admin? )
34
- list.logger.info "Rejecting mail as not from admin."
35
- return Errors::MessageNotFromAdmin.new(list)
36
- end
37
- end
38
- end
39
- end