all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] [PATCH] fix #2228: automatically deliver/delete on whitelist/blacklist
@ 2021-03-30 15:05 Thomas Lamprecht
  2021-03-31 11:44 ` [pmg-devel] applied: " Stoiko Ivanov
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Lamprecht @ 2021-03-30 15:05 UTC (permalink / raw)
  To: pmg-devel

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@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') {
-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pmg-devel] applied: [PATCH] fix #2228: automatically deliver/delete on whitelist/blacklist
  2021-03-30 15:05 [pmg-devel] [PATCH] fix #2228: automatically deliver/delete on whitelist/blacklist Thomas Lamprecht
@ 2021-03-31 11:44 ` Stoiko Ivanov
  0 siblings, 0 replies; 2+ messages in thread
From: Stoiko Ivanov @ 2021-03-31 11:44 UTC (permalink / raw)
  To: Thomas Lamprecht; +Cc: pmg-devel


On Tue, 30 Mar 2021 17:05:47 +0200
Thomas Lamprecht <t.lamprecht@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@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!





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-31 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 15:05 [pmg-devel] [PATCH] fix #2228: automatically deliver/delete on whitelist/blacklist Thomas Lamprecht
2021-03-31 11:44 ` [pmg-devel] applied: " Stoiko Ivanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal