From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Stoiko Ivanov <s.ivanov@proxmox.com>
Cc: pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] [PATCH pmg-api 2/2] smtputf8: keep smtputf8 from incoming postfix, detect for local mail
Date: Wed, 25 Jan 2023 11:04:41 +0100 [thread overview]
Message-ID: <c4232ec9-be84-f93f-e257-24e6e2951b9e@proxmox.com> (raw)
In-Reply-To: <20230125104844.304dca6b@rosa.proxmox.com>
Am 25/01/2023 um 10:48 schrieb Stoiko Ivanov:
> On Wed, 25 Jan 2023 10:30:09 +0100
> Thomas Lamprecht <t.lamprecht@proxmox.com> wrote:
>>
>>> - PMG::Utils::reinject_mail ($mail, '', [$receiver], undef, $fqdn);
>>> +
>>> + my $params;
>>> + if (PMG::Utils::mail_needs_smtputf8($mail, '', [$receiver])) {
>>> + $params->{mail}->{smtputf8} = 1;
>>> + }
>>
>> I'd rather move this into reinject mail instead of copyi-pastaing the same
>> code hunk five times around, after all it has all the info required to
>> call mail_needs_smtputf8 there. FWICT, its done on all call sites, so you
>> wouldn't even require to add an opt-out param.
>
> The call-sites it's not added are the ones in the rulesystem -
> (PMG::RuleDB::Accept/BCC) - where the mail is received from the outside
> and where we don't want to autodetect the need, but simply reuse what
> postfix sends us.
> (maybe I could have written that a bit more explicitly in the
> commit-message)
>
then either:
create a wrapper method that adds that param handling and switch the call
sites here over to that or move it still into reinject_mail but allow for
opt-ing out. I'd favor the first varian, as that then also allows for some
clear naming distinction for which flow (direction) which method should be
called.
>>
>>> + PMG::Utils::reinject_mail ($mail, '', [$receiver], undef, $fqdn, $params);
>>> }
>>>
>>> __PACKAGE__->register_method ({
>>
>>
>>> diff --git a/src/PMG/Utils.pm b/src/PMG/Utils.pm
>>> index 9c6f841..1ccd7d2 100644
>>> --- a/src/PMG/Utils.pm
>>> +++ b/src/PMG/Utils.pm
>>> @@ -232,6 +232,10 @@ sub mail_needs_smtputf8 {
>>> }
>>> }
>>>
>>> + if ($entity->head()->as_string() =~ /([^\p{PosixPrint}\n\r\t])/) {
>>> + return 1;
>>> + }
>>
>>
>> you're reintroducing the hunk you removed in patch 1/2 without really adding any
>> explicit reasoning, or is 1/2 just intended as uncontroversial stop gap to apply
>> while 2/2 is still being checked more closely, or what's the deal here?
>
> The idea was to apply 1/2 (as stop-gap measure) quite soon and get it out -
> so that most users with disabled smtputf8 and non-ascii characters in
> received mail get their systems working again, while 2/2 was something
> that might benefit from a more through review.
> I'll try to rewrite the commit message to reference 1/2 (or it's commit
> hash once applied) explicitly
>
Please mention that explicitly the next time.
prev parent reply other threads:[~2023-01-25 10:05 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 ` [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 message]
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=c4232ec9-be84-f93f-e257-24e6e2951b9e@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
--cc=s.ivanov@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