all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine.
@ 2025-10-13 11:06 Stoiko Ivanov
  2025-10-13 11:06 ` [pmg-devel] [PATCH pmg-api 1/2] api: quarantine: fix wrong backward-compatibility action Stoiko Ivanov
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Stoiko Ivanov @ 2025-10-13 11:06 UTC (permalink / raw)
  To: pmg-devel

This patchset addresses two reports of issues with the spamreports sent
to users occurring after upgrading to PMG 9.0

First I mistakenly added welcomelist twice as action (instead of
welcomelist and whitelist for backward compatibility)

Second the ordering of the mime-parts for text/plain and text/html reports
was wrong compared to RFC recommendations (and displaying in different
MUAs).

Stoiko Ivanov (2):
  api: quarantine: fix wrong backward-compatibility action
  utils: finalize_report: change order of plain and html parts

 src/PMG/API2/Quarantine.pm |  2 +-
 src/PMG/Utils.pm           | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

-- 
2.47.3



_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel


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

* [pmg-devel] [PATCH pmg-api 1/2] api: quarantine: fix wrong backward-compatibility action
  2025-10-13 11:06 [pmg-devel] [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine Stoiko Ivanov
@ 2025-10-13 11:06 ` Stoiko Ivanov
  2025-10-13 11:06 ` [pmg-devel] [PATCH pmg-api 2/2] utils: finalize_report: change order of plain and html parts Stoiko Ivanov
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Stoiko Ivanov @ 2025-10-13 11:06 UTC (permalink / raw)
  To: pmg-devel

While renaming to blocklist/welcomelist we kept the old
methods in the API for backward compatibilty, and added
both options as equivalent actions.
However it seems I substituted the backward compatibility name, as
well at some point and did not notice it.

Additionally the commits of renaming and re-adding the old names for
backward compatibility were not separated cleanly (thus this
patch fixes 2 commits).

Reported in our German community forum:
https://forum.proxmox.com/threads/.173910/

Tested by reproducing with a spamreport template with the old actions,
and verified that the welcomelist action works with this patch.

Fixes: ba7a7855 ("api: quarantine: re-add black- whitelist api methods for compatibilty")
Fixes: 85981ebd ("api: quarantine: rename to block/welcomelist")
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/PMG/API2/Quarantine.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PMG/API2/Quarantine.pm b/src/PMG/API2/Quarantine.pm
index 3887a741..e38d3ab2 100644
--- a/src/PMG/API2/Quarantine.pm
+++ b/src/PMG/API2/Quarantine.pm
@@ -1433,7 +1433,7 @@ __PACKAGE__->register_method({
             my $pmail = try_decode_utf8($ref->{pmail});
             my $receiver = try_decode_utf8($ref->{receiver} // $ref->{pmail});
 
-            if ($action eq 'welcomelist' || $action eq 'welcomelist') {
+            if ($action eq 'welcomelist' || $action eq 'whitelist') {
                 PMG::Quarantine::add_to_blockwelcome($dbh, $pmail, 'WL', [$sender]);
                 PMG::Quarantine::deliver_quarantined_mail($dbh, $ref, $receiver);
             } elsif ($action eq 'blocklist' || $action eq 'blacklist') {
-- 
2.47.3



_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel


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

* [pmg-devel] [PATCH pmg-api 2/2] utils: finalize_report: change order of plain and html parts
  2025-10-13 11:06 [pmg-devel] [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine Stoiko Ivanov
  2025-10-13 11:06 ` [pmg-devel] [PATCH pmg-api 1/2] api: quarantine: fix wrong backward-compatibility action Stoiko Ivanov
@ 2025-10-13 11:06 ` Stoiko Ivanov
  2025-10-13 14:24 ` [pmg-devel] [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine Dominik Csapak
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Stoiko Ivanov @ 2025-10-13 11:06 UTC (permalink / raw)
  To: pmg-devel

After 2 reports and a hint in our community forum [0] that the reports
are displayed differently since the upgrade - I checked the MIME-RFC:
https://datatracker.ietf.org/doc/html/rfc2046#section-5.1.4

which suggests to add the most preferred alternative last (so that
text/plain comes in the beginning which is nicer to view for
mail-clients which do not handle MIME at all).

I had chalked this up to my MUAs preferring text/plain where possible.

Tested this by comparing a spamreport sent with this patch applied in
* claws-mail
* mutt
* bluemind webmail
* aerc

[0] https://forum.proxmox.com/threads/.173435/
Fixes: 542f7279 ("utils: allow specifying plain and/or html for finalize_report()")
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/PMG/Utils.pm | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/PMG/Utils.pm b/src/PMG/Utils.pm
index a2cd3fc4..52b98c01 100644
--- a/src/PMG/Utils.pm
+++ b/src/PMG/Utils.pm
@@ -1370,13 +1370,6 @@ sub finalize_report {
         Subject => bencode_header(decode_entities($title)),
     );
 
-    if ($html) {
-        $top->attach(
-            Data => $html,
-            Type => "text/html",
-            Encoding => $debug ? 'binary' : 'quoted-printable',
-        );
-    }
     if ($plaintext) {
         $top->attach(
             Data => $plaintext,
@@ -1384,6 +1377,13 @@ sub finalize_report {
             Encoding => '8-bit',
         );
     }
+    if ($html) {
+        $top->attach(
+            Data => $html,
+            Type => "text/html",
+            Encoding => $debug ? 'binary' : 'quoted-printable',
+        );
+    }
 
     $top->head()->add('Auto-Submitted', 'auto-generated');
 
-- 
2.47.3



_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel


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

* Re: [pmg-devel] [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine.
  2025-10-13 11:06 [pmg-devel] [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine Stoiko Ivanov
  2025-10-13 11:06 ` [pmg-devel] [PATCH pmg-api 1/2] api: quarantine: fix wrong backward-compatibility action Stoiko Ivanov
  2025-10-13 11:06 ` [pmg-devel] [PATCH pmg-api 2/2] utils: finalize_report: change order of plain and html parts Stoiko Ivanov
@ 2025-10-13 14:24 ` Dominik Csapak
  2025-10-13 15:09 ` [pmg-devel] applied-series: " Stoiko Ivanov
  2025-10-13 16:36 ` [pmg-devel] applied: " Thomas Lamprecht
  4 siblings, 0 replies; 6+ messages in thread
From: Dominik Csapak @ 2025-10-13 14:24 UTC (permalink / raw)
  To: Stoiko Ivanov, pmg-devel

both patches look good to me & tested fine

Consider both:

Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>


_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel


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

* [pmg-devel] applied-series: [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine.
  2025-10-13 11:06 [pmg-devel] [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine Stoiko Ivanov
                   ` (2 preceding siblings ...)
  2025-10-13 14:24 ` [pmg-devel] [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine Dominik Csapak
@ 2025-10-13 15:09 ` Stoiko Ivanov
  2025-10-13 16:36 ` [pmg-devel] applied: " Thomas Lamprecht
  4 siblings, 0 replies; 6+ messages in thread
From: Stoiko Ivanov @ 2025-10-13 15:09 UTC (permalink / raw)
  To: pmg-devel

applied both patches with Dominik's T-b/R-b
Thanks!

On Mon, 13 Oct 2025 13:06:17 +0200
Stoiko Ivanov <s.ivanov@proxmox.com> wrote:

> This patchset addresses two reports of issues with the spamreports sent
> to users occurring after upgrading to PMG 9.0
> 
> First I mistakenly added welcomelist twice as action (instead of
> welcomelist and whitelist for backward compatibility)
> 
> Second the ordering of the mime-parts for text/plain and text/html reports
> was wrong compared to RFC recommendations (and displaying in different
> MUAs).
> 
> Stoiko Ivanov (2):
>   api: quarantine: fix wrong backward-compatibility action
>   utils: finalize_report: change order of plain and html parts
> 
>  src/PMG/API2/Quarantine.pm |  2 +-
>  src/PMG/Utils.pm           | 14 +++++++-------
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 



_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel


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

* [pmg-devel] applied: [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine.
  2025-10-13 11:06 [pmg-devel] [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine Stoiko Ivanov
                   ` (3 preceding siblings ...)
  2025-10-13 15:09 ` [pmg-devel] applied-series: " Stoiko Ivanov
@ 2025-10-13 16:36 ` Thomas Lamprecht
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2025-10-13 16:36 UTC (permalink / raw)
  To: pmg-devel, Stoiko Ivanov

On Mon, 13 Oct 2025 13:06:17 +0200, Stoiko Ivanov wrote:
> This patchset addresses two reports of issues with the spamreports sent
> to users occurring after upgrading to PMG 9.0
> 
> First I mistakenly added welcomelist twice as action (instead of
> welcomelist and whitelist for backward compatibility)
> 
> Second the ordering of the mime-parts for text/plain and text/html reports
> was wrong compared to RFC recommendations (and displaying in different
> MUAs).
> 
> [...]

Applied, thanks!

[1/2] api: quarantine: fix wrong backward-compatibility action
      (no commit info)
[2/2] utils: finalize_report: change order of plain and html parts
      (no commit info)


_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel


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

end of thread, other threads:[~2025-10-13 16:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-13 11:06 [pmg-devel] [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine Stoiko Ivanov
2025-10-13 11:06 ` [pmg-devel] [PATCH pmg-api 1/2] api: quarantine: fix wrong backward-compatibility action Stoiko Ivanov
2025-10-13 11:06 ` [pmg-devel] [PATCH pmg-api 2/2] utils: finalize_report: change order of plain and html parts Stoiko Ivanov
2025-10-13 14:24 ` [pmg-devel] [PATCH pmg-api 0/2] fix 2 issues with spamreports and quarantine Dominik Csapak
2025-10-13 15:09 ` [pmg-devel] applied-series: " Stoiko Ivanov
2025-10-13 16:36 ` [pmg-devel] applied: " Thomas Lamprecht

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