Better handling of decryption problems
It can happen that folks might use the wrong key to a list or they even send an email with symmetric encryption.
At the moment this fires an exception and the mail is bounced, as well as the super admins notified.
In both cases we get an exception that we could actually catch and then handle the error in a better way.
Imho we should accept the email als delivered (so nothing gets thrown at the user), BUT notify the list admins that someone tried to send an email to the list, that schleuder could not handle and attach it. Then the admins could decide what to do.
Another option would be to still bounce the email but be more specific about why it bounced. E.g. saying: we cannot decrypt your email, so we did not accept it. And still inform the list admins about it.
So 2 options:
- Accept email from an MTA perspective and notify list admins.
- Still bounce email but describe the problem that occured and notify the list admins.
The major change would be that super admins would not get notified anymore (if schleuder can detect the problem), as they are usually the wrong ones to care about the problem.
I would opt for option 1, as describing the problem better might only help in a few corner cases, where senders with a technical understanding can act on the reported problem. Most folks will either ignore the bounce or just be confused.
The list admins are probably the ones that can decide best what to do and if they don't know, then they are still the best ones to ask the super admins.
Opinions?
This is a sample stacktrace of an issue with a an email using symmetric encryption.
Bad passphrase
/opt/schleuder/bundler/ruby/2.4.0/gems/gpgme-2.0.16/lib/gpgme/ctx.rb:435:in `decrypt_verify'
/opt/schleuder/bundler/ruby/2.4.0/gems/mail-gpg-0.3.1/lib/mail/gpg/gpgme_helper.rb:54:in `block in decrypt'
/opt/schleuder/bundler/ruby/2.4.0/gems/gpgme-2.0.16/lib/gpgme/ctx.rb:79:in `new'
/opt/schleuder/bundler/ruby/2.4.0/gems/mail-gpg-0.3.1/lib/mail/gpg/gpgme_helper.rb:51:in `decrypt'
/opt/schleuder/bundler/ruby/2.4.0/gems/mail-gpg-0.3.1/lib/mail/gpg/decrypted_part.rb:14:in `initialize'
/opt/schleuder/bundler/ruby/2.4.0/gems/mail-gpg-0.3.1/lib/mail/gpg.rb:125:in `new'
/opt/schleuder/bundler/ruby/2.4.0/gems/mail-gpg-0.3.1/lib/mail/gpg.rb:125:in `decrypt_pgp_mime'
/opt/schleuder/bundler/ruby/2.4.0/gems/mail-gpg-0.3.1/lib/mail/gpg.rb:66:in `decrypt'
/opt/schleuder/bundler/ruby/2.4.0/gems/mail-gpg-0.3.1/lib/mail/gpg/message_patch.rb:67:in `decrypt'
/opt/schleuder/lib/schleuder/mail/message.rb:25:in `setup'
/opt/schleuder/lib/schleuder/runner.rb:15:in `run'
/opt/schleuder/lib/schleuder/cli.rb:35:in `work'
/opt/schleuder/bundler/ruby/2.4.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
/opt/schleuder/bundler/ruby/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
/opt/schleuder/bundler/ruby/2.4.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
/opt/schleuder/bundler/ruby/2.4.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
/opt/schleuder/bin/schleuder:12:in `<top (required)>'
/opt/schleuder/bundler/ruby/2.4.0/bin/schleuder:22:in `load'
/opt/schleuder/bundler/ruby/2.4.0/bin/schleuder:22:in `<top (required)>'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `load'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/exe/bundle:34:in `block in <top (required)>'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/bundler-1.13.7/exe/bundle:26:in `<top (required)>'
/opt/rh/rh-ruby24/root/usr/bin/bundle:22:in `load'
/opt/rh/rh-ruby24/root/usr/bin/bundle:22:in `<main>'