public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] [PATCH pmg-api 0/2] fix smtputf8 handling if disabled in postfix
@ 2023-01-23 15:55 Stoiko Ivanov
  2023-01-23 15:55 ` [pmg-devel] [PATCH pmg-api 1/2] utils: skip checking headers for non-ascii characters Stoiko Ivanov
  2023-01-23 15:55 ` [pmg-devel] [PATCH pmg-api 2/2] smtputf8: keep smtputf8 from incoming postfix, detect for local mail Stoiko Ivanov
  0 siblings, 2 replies; 7+ messages in thread
From: Stoiko Ivanov @ 2023-01-23 15:55 UTC (permalink / raw)
  To: pmg-devel

This series addresses an issue some of our users reported in our
community forum with pmg-api_7.2-3:
* the decision if smtputf8 is needed is based on the envelope-addresses
  and the headers (if they contain non-ascii characters we use SMTPUTF8
* this breaks environments where SMTPUTF8 is disabled (mostly because
  some downstream servers do not support this), but mails still contain
  non-ascii data (while this is against the relevant rfc, which say that
  header-data must contain only ascii characters (and should be encoded
  with MIME-words otherwise), it is seemingly quite common in the wild)

one testmail I got from a user from the forum had the From header
correctly encoded, but added an X-DFrom header with the unencoded from.

The first patch simply drops the header-inspection and should enable
most of the reporters to receive mail again.

The second patch tries to address the smtputf8 issue a bit differently
than what we currently do
- For mails received via SMTP it simply sets SMTPUTF8 if the original
  postfix processes sent pmg-smtp-filter the mail with the flag, and
  does not set it otherwise
- For locally generated mail it detects if its needed by checking the
  envelope-addresses and the headers for non-ascii characters.

This should follow postfix own functioning quite closely:
https://www.postfix.org/SMTPUTF8_README.html

processing by pmg-smtp-filter should not change the need for the flag,
since we don't rewrite envelope-addresses, and modify filed does
mime-encode the resulting header.

Sending as two patches, since the first one would be good to get out
soon (as it's affecting a few setups), while the second one might
benefit from a bit more testing (I did some tests, which all looked
good, but might have overlooked some cases)

Stoiko Ivanov (2):
  utils: skip checking headers for non-ascii characters
  smtputf8: keep smtputf8 from incoming postfix, detect for local mail

 src/PMG/API2/Quarantine.pm |  7 ++++++-
 src/PMG/RuleDB/Notify.pm   |  6 +++++-
 src/PMG/SMTP.pm            |  7 ++++++-
 src/PMG/Utils.pm           | 12 +++++++++---
 4 files changed, 26 insertions(+), 6 deletions(-)

-- 
2.30.2





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

end of thread, other threads:[~2023-01-25 10:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [pmg-devel] [PATCH pmg-api 1/2] utils: skip checking headers for non-ascii characters Stoiko Ivanov
2023-01-25 10:04   ` [pmg-devel] applied: " 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

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