[pmg-devel] [PATCH pmg-api 1/2] utils: skip checking headers for non-ascii characters

Stoiko Ivanov s.ivanov at proxmox.com
Mon Jan 23 16:55:20 CET 2023


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 at 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





More information about the pmg-devel mailing list