Stoiko,
The timeline, from my point of view is this:
1. We have been successfully receiving mails with UTF8 in the envelope addresses for years, through PMG, into an Exchange 2010 server
2. An update applied on January 5 broke mail flow. That update bumped pmg-api to 7.2-3. Emails were being bounced by PMG Postfix because SMTPUTF8 was now being required, but not offered by Exchange 2010:
Jan 8 01:00:23 gtpmg postfix/smtp[34680]: 6BC25C0CCB: to=<REDACTED@availink.com>, relay=OUREXCHANGESERVER[10.209.144.32]:25, delay=0.06, delays=0.05/0/0/0, dsn=5.6.7, status=bounced (SMTPUTF8 is required, but was not offered by host 10.209.144.32[10.209.144.32])
3. Furthermore, it looks like the undeliverable reports sent back to the sender also failed because of lack of SMTPUTF8 on their side:
Jan 8 01:00:24 gtpmg postfix/smtp[34680]: 7D2BEC0CF2: to=<REDACTED@Sigurd.com.tw>, relay=mg.Sigurd.com.tw[59.120.59.92]:25, delay=1.1, delays=0/0/1.1/0, dsn=5.6.7, status=bounced (SMTPUTF8 is required, but was not offered by host mg.Sigurd.com.tw[59.120.59.92])
4. Having newly learned about SMTPUTF8, I added smtputf8_enable=no to PMG Postfix main.c with the understanding that that would make Postfix ignorant to SMTPUTF8, restoring historical behavior. However, after doing that, mail flow was broken in a new way. PMG Postfix was suddenly unhappy to see SMTPUTF8 requested by PMG when reinjecting the email:
Jan 11 09:08:16 gtpmg postfix/qmgr[91208]: 6230DC167B: from=<REDACTED@sigurd.com.tw>, size=119588, nrcpt=8 (queue active)
Jan 11 09:08:16 gtpmg pmg-smtp-filter[103815]: 2023/01/11-09:08:16 CONNECT TCP Peer: "[127.0.0.1]:54472" Local: "[127.0.0.1]:10024"
Jan 11 09:08:16 gtpmg pmg-smtp-filter[103815]: C156363BEC2D06365B: new mail message-id=<7FC68833625C0348A2E1A8C40E123C660160A162A8@MBX4.sigurd.com.tw>#012
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: C156363BEC2D06365B: SA score=0/5 time=1.346 bayes=0.00 autolearn=no autolearn_force=no hits=AWL(-0.048),BAYES_00(-1.9),DKIM_INVALI
D(0.1),DKIM_SIGNED(0.1),HTML_FONT_FACE_BAD(0.001),HTML_MESSAGE(0.001),KAM_DMARC_STATUS(0.01),KAM_MANYTO(0.2),SPF_HELO_NONE(0.001),SPF_PASS(-0.001)
Jan 11 09:08:17 gtpmg postfix/smtpd[111884]: connect from localhost.localdomain[127.0.0.1]
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: smtp error - got: 555 5.5.4 Unsupported option: SMTPUTF8#012
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: smtp from: ERROR at /usr/share/perl5/PMG/Utils.pm line 279.
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: C156363BEC2D06365B: reinject mail to <REDACTED@availink.com> (rule: Whitelist) failed
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: C156363BEC2D06365B: reinject mail to <REDACTED@availink.com> (rule: Whitelist) failed
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: C156363BEC2D06365B: reinject mail to <REDACTED@availink.com> (rule: Whitelist) failed
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: C156363BEC2D06365B: reinject mail to <REDACTED@availink.com> (rule: Whitelist) failed
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: C156363BEC2D06365B: reinject mail to <REDACTED@availink.com> (rule: Whitelist) failed
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: C156363BEC2D06365B: reinject mail to <REDACTED@availink.com> (rule: Whitelist) failed
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: C156363BEC2D06365B: reinject mail to <REDACTED@availink.com> (rule: Whitelist) failed
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: C156363BEC2D06365B: reinject mail to <REDACTED@availink.com> (rule: Whitelist) failed
Jan 11 09:08:17 gtpmg postfix/smtpd[111884]: lost connection after MAIL from localhost.localdomain[127.0.0.1]
Jan 11 09:08:17 gtpmg postfix/smtpd[111884]: disconnect from localhost.localdomain[127.0.0.1] ehlo=1 xforward=1 mail=0/1 commands=2/3
Jan 11 09:08:17 gtpmg pmg-smtp-filter[103815]: C156363BEC2D06365B: processing time: 1.404 seconds (1.346, 0.019, 0)
Jan 11 09:08:17 gtpmg postfix/lmtp[111846]: 6230DC167B: to=<REDACTED@availink.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=11327, delays=11325/0/0.04/1.4, dsn=4.4.0, status=defe
rred (host 127.0.0.1[127.0.0.1] said: 451 4.4.0 detected undelivered mail to <REDACTED@availink.com> (in reply to end of DATA command))
5. My hack to restore mail flow was to comment out the line that was enabling SMTPUTF8 when envelope addresses contain non-ASCII characters. /usr/share/perl5/PMG/Utils.pm line 267:
#HACK $mail_opts .= " SMTPUTF8" if mail_needs_smtputf8($entity, $sender, $targets);
My understanding about SMTPUTF8, learned solely through this experience and some reading about it, is that it's apparently not strictly necessary in order for mail to be exchanged with non-ASCII envelope addresses. We had been doing this for years without it. #3 above shows that the sender does not support SMTPUTF8 and was not requesting it, so even though modern Postfix had support for it enabled by default, it was not being requested upon forwarding to our Exchange server until the change in pmg-api 7.2-3 was made to assert it independently of whether support for it was enabled or not.
Unfortunately I don't have the emails on hand, but I did verify that the envelope addresses (to and from) contained UTF-8.