bounces_drop_all=true does not bounce but circumvents all filters
Expected Behavior
bounces_drop_all=true
should result in all bounces being dropped and not interfere with other filters
(e.g. in case receive_encrypted_only=true
and someone sends in non-encrypted message, there should be no bounce message to that person notifying them that they have to encrypt the message AND the message should not be sent to the list)
Actual Behavior
There is no bounce, which is okay. But the unencrypted message will then be distributed to the list even with receive_encrypted_only=true
, which is not okay.
Steps to Reproduce the Problem
- Set
receive_encrypted_only=true
. Test that this results in a bounce if someone sends an unencrypted message. The message is correctly not distributed to the list. - Set
bounces_drop_all=true
additionally. Test again with same unencrypted message. No bounce which is okay, but the unencrypted message will be processed and distributed to the list, which should not be the case.
Specifications
- Version: 4.0.2 (and also reproducable in 3.5.3)
- Installation method (package, gem...): package/gem
- Mail client version: all
Other information
I quickly debugged it and I think, maybe it is because of bounces_drop_all=true
causes:
https://0xacab.org/schleuder/schleuder/-/blob/main/lib/schleuder/filters_runner.rb#L39 to return false
This causes run() to return nil: https://0xacab.org/schleuder/schleuder/-/blob/main/lib/schleuder/filters_runner.rb#L19
Which causes this to return nil: https://0xacab.org/schleuder/schleuder/-/blob/main/lib/schleuder/runner.rb#L89
I think this then causes this no error return: https://0xacab.org/schleuder/schleuder/-/blob/main/lib/schleuder/runner.rb#L34
error = run_filters('post')
return error if error
Which means, as the run() does not return early, the message is still being sent to everyone.
Is it possible for you to reproduce? Does my debugging makes sense? I can work on a fix if you can reproduce it and think this is not intended.