[pmg-devel] applied: [PATCH] fix #2228: automatically deliver/delete on whitelist/blacklist

Stoiko Ivanov s.ivanov at proxmox.com
Wed Mar 31 13:44:21 CEST 2021


On Tue, 30 Mar 2021 17:05:47 +0200
Thomas Lamprecht <t.lamprecht at proxmox.com> wrote:

> If a user chooses to blacklist a specific sender of a mail, the mail
> is highly probably undesired too, so delete it in that case.
> 
> The reverse should hold for white listing a mail's sender, deliver it
> in that case.
> 
> Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
> ---
> 
> The bug report talked about doing this opt-out, but I really do not see when
> one would think along the lines of "that sender is always spam, blacklist them
> but keep that specific mail" so just do it unconditionally.
> 
>  src/PMG/API2/Quarantine.pm | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/PMG/API2/Quarantine.pm b/src/PMG/API2/Quarantine.pm
> index 848ae8e..2fa1bb4 100644
> --- a/src/PMG/API2/Quarantine.pm
> +++ b/src/PMG/API2/Quarantine.pm
> @@ -1228,8 +1228,10 @@ __PACKAGE__->register_method ({
>  
>  	    if ($action eq 'whitelist') {
>  		PMG::Quarantine::add_to_blackwhite($dbh, $ref->{pmail}, 'WL', [ $sender ]);
> +		PMG::Quarantine::deliver_quarantined_mail($dbh, $ref, $ref->{receiver} // $ref->{pmail});
>  	    } elsif ($action eq 'blacklist') {
>  		PMG::Quarantine::add_to_blackwhite($dbh, $ref->{pmail}, 'BL', [ $sender ]);
> +		PMG::Quarantine::delete_quarantined_mail($dbh, $ref);
>  	    } elsif ($action eq 'deliver') {
>  		PMG::Quarantine::deliver_quarantined_mail($dbh, $ref, $ref->{receiver} // $ref->{pmail});
>  	    } elsif ($action eq 'delete') {


reviewed, tested and applied the patch (with my R-b, T-b tags) - huge
thanks!





More information about the pmg-devel mailing list