public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] applied: [PATCH] fix #2228: automatically deliver/delete on whitelist/blacklist
Date: Wed, 31 Mar 2021 13:44:21 +0200	[thread overview]
Message-ID: <20210331134421.70674821@rosa.proxmox.com> (raw)
In-Reply-To: <20210330150547.21333-1-t.lamprecht@proxmox.com>


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!





      reply	other threads:[~2021-03-31 11:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 15:05 [pmg-devel] " Thomas Lamprecht
2021-03-31 11:44 ` Stoiko Ivanov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210331134421.70674821@rosa.proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal