all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-api 1/2] utils: skip checking headers for non-ascii characters
Date: Mon, 23 Jan 2023 16:55:20 +0100	[thread overview]
Message-ID: <20230123155521.28307-2-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20230123155521.28307-1-s.ivanov@proxmox.com>

the fix for smtputf8 enablement in
191e4709e99a5975fa66cf21847887566e108501 was a bit too eager and broke
the mailflow of a few users, who have smtputf8 disabled in their
postfix config (because their downstream servers do not support this):

The issue here is that the mails they process have had
(non-rfc-compliant) non-ascii header contents, which used to work
before the patch. The postfix smtputf8 howto explains quite well that
postfix never cared too much about headers (or local-parts of
addresses) before smtputf8 [1]
```
Postfix already permitted UTF-8 in message header values and in
address localparts. This does not change.
```

While the patch only ignores the headers and still could cause issues
with non-ascii local-parts, those should occur far less frequently in
the wild (none of the reporters in our forum had this).

tested with a mail with an Euro sign in a 'X-From:' header.

[0] https://forum.proxmox.com/threads/.120886/
[1] https://www.postfix.org/SMTPUTF8_README.html#enabling

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/PMG/Utils.pm | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/PMG/Utils.pm b/src/PMG/Utils.pm
index 825b8d9..9c6f841 100644
--- a/src/PMG/Utils.pm
+++ b/src/PMG/Utils.pm
@@ -232,10 +232,6 @@ sub mail_needs_smtputf8 {
 	}
     }
 
-    if ($entity->head()->as_string() =~ /([^\p{PosixPrint}\n\r\t])/) {
-	return 1;
-    }
-
     return 0;
 }
 
-- 
2.30.2





  reply	other threads:[~2023-01-23 15:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 15:55 [pmg-devel] [PATCH pmg-api 0/2] fix smtputf8 handling if disabled in postfix Stoiko Ivanov
2023-01-23 15:55 ` Stoiko Ivanov [this message]
2023-01-25 10:04   ` [pmg-devel] applied: [PATCH pmg-api 1/2] utils: skip checking headers for non-ascii characters Thomas Lamprecht
2023-01-23 15:55 ` [pmg-devel] [PATCH pmg-api 2/2] smtputf8: keep smtputf8 from incoming postfix, detect for local mail Stoiko Ivanov
2023-01-25  9:30   ` Thomas Lamprecht
2023-01-25  9:48     ` Stoiko Ivanov
2023-01-25 10:04       ` Thomas Lamprecht

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=20230123155521.28307-2-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pmg-devel@lists.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 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