public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] [PATCH pmg-api] quarantine: delete Delivered-To and Return-Path when reinjecting
@ 2023-03-27 19:18 Stoiko Ivanov
  2023-03-28  5:59 ` [pmg-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2023-03-27 19:18 UTC (permalink / raw)
  To: pmg-devel

The removal of those 2 headers was dropped in the recent rework for
quarantine delivery.
Leading to mails from quarantine being bounced by postfix 'local'
delivery agent (as the comment in the original code stated)

Reproduced by delivering a mail from quarantine to a postfix instance,
which routes it to a local account

Fixes: e51fe74 ("quarantine: use reinject_local_mail to deliver quarantined mail")
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
noticed while testing if the OCR detection of SpamAssassin actually works
Huge Thanks to Martin for suggesting the test!

 src/PMG/Quarantine.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/PMG/Quarantine.pm b/src/PMG/Quarantine.pm
index bd5e63b..b80a5a3 100644
--- a/src/PMG/Quarantine.pm
+++ b/src/PMG/Quarantine.pm
@@ -108,6 +108,11 @@ sub deliver_quarantined_mail {
     my $entity = $parser->parse_open("$path");
     PMG::MIMEUtils::fixup_multipart($entity);
 
+    # delete Delivered-To and Return-Path (avoid problem with postfix
+    # forwarding loop detection (man local))
+    $entity->head->delete('Delivered-To');
+    $entity->head->delete('Return-Path');
+
     my $sender = 'postmaster'; # notify postmaster if something fails
 
     eval {
-- 
2.30.2





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

* [pmg-devel] applied: [PATCH pmg-api] quarantine: delete Delivered-To and Return-Path when reinjecting
  2023-03-27 19:18 [pmg-devel] [PATCH pmg-api] quarantine: delete Delivered-To and Return-Path when reinjecting Stoiko Ivanov
@ 2023-03-28  5:59 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-03-28  5:59 UTC (permalink / raw)
  To: Stoiko Ivanov, pmg-devel

Am 27/03/2023 um 21:18 schrieb Stoiko Ivanov:
> The removal of those 2 headers was dropped in the recent rework for
> quarantine delivery.
> Leading to mails from quarantine being bounced by postfix 'local'
> delivery agent (as the comment in the original code stated)
> 
> Reproduced by delivering a mail from quarantine to a postfix instance,
> which routes it to a local account
> 
> Fixes: e51fe74 ("quarantine: use reinject_local_mail to deliver quarantined mail")
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
> noticed while testing if the OCR detection of SpamAssassin actually works
> Huge Thanks to Martin for suggesting the test!
> 
>  src/PMG/Quarantine.pm | 5 +++++
>  1 file changed, 5 insertions(+)
> 
>

applied, thanks!




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

end of thread, other threads:[~2023-03-28  5:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 19:18 [pmg-devel] [PATCH pmg-api] quarantine: delete Delivered-To and Return-Path when reinjecting Stoiko Ivanov
2023-03-28  5:59 ` [pmg-devel] applied: " Thomas Lamprecht

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