* [PATCH pmg-api v2] config: do not shortcircuit smtp-welcomelist generation
@ 2026-06-09 9:03 Stoiko Ivanov
2026-06-09 9:11 ` Dominik Csapak
2026-06-09 9:19 ` applied: " Stoiko Ivanov
0 siblings, 2 replies; 3+ messages in thread
From: Stoiko Ivanov @ 2026-06-09 9:03 UTC (permalink / raw)
To: pmg-devel
combining the results with ||= causes the write_smtp_welcomelist calls
not to be run, after the first one signals a change.
gather the combined changes in a different variable, to ensure each
config-file is actually created/written, as postfix refuses to run if
its config files are missing.
Fixes: de0ba685 ("fix #3991: record changes to the smtp-welcomelist and reload postfix")
Reported-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
v1->v2:
* fix the use of ||= I kept by mistake for the 3. and 4. call to
write_smtp_welcomlist - thanks to Dominik for spotting it!
src/PMG/Config.pm | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/PMG/Config.pm b/src/PMG/Config.pm
index 2d2b6c83..f48c31dc 100644
--- a/src/PMG/Config.pm
+++ b/src/PMG/Config.pm
@@ -1878,10 +1878,15 @@ sub rewrite_postfix_welcomelist {
}
my $changes = 0;
- $changes ||= $write_smtp_welcomelist->("/etc/postfix/senderaccess", $fromlist);
- $changes ||= $write_smtp_welcomelist->("/etc/postfix/rcptaccess", $tolist);
- $changes ||= $write_smtp_welcomelist->("/etc/postfix/clientaccess", $clientlist);
- $changes ||= $write_smtp_welcomelist->("/etc/postfix/postscreen_access", $clientlist, 'permit');
+ my $ret;
+ $ret = $write_smtp_welcomelist->("/etc/postfix/senderaccess", $fromlist);
+ $changes ||= $ret;
+ $ret = $write_smtp_welcomelist->("/etc/postfix/rcptaccess", $tolist);
+ $changes ||= $ret;
+ $ret = $write_smtp_welcomelist->("/etc/postfix/clientaccess", $clientlist);
+ $changes ||= $ret;
+ $ret = $write_smtp_welcomelist->("/etc/postfix/postscreen_access", $clientlist, 'permit');
+ $changes ||= $ret;
return $changes;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH pmg-api v2] config: do not shortcircuit smtp-welcomelist generation
2026-06-09 9:03 [PATCH pmg-api v2] config: do not shortcircuit smtp-welcomelist generation Stoiko Ivanov
@ 2026-06-09 9:11 ` Dominik Csapak
2026-06-09 9:19 ` applied: " Stoiko Ivanov
1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-06-09 9:11 UTC (permalink / raw)
To: Stoiko Ivanov, pmg-devel
after applying these changes and rebooting, receiving mail works again.
changes look sensible, so
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
On 6/9/26 11:04 AM, Stoiko Ivanov wrote:
> combining the results with ||= causes the write_smtp_welcomelist calls
> not to be run, after the first one signals a change.
> gather the combined changes in a different variable, to ensure each
> config-file is actually created/written, as postfix refuses to run if
> its config files are missing.
>
> Fixes: de0ba685 ("fix #3991: record changes to the smtp-welcomelist and reload postfix")
> Reported-by: Dominik Csapak <d.csapak@proxmox.com>
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
> v1->v2:
> * fix the use of ||= I kept by mistake for the 3. and 4. call to
> write_smtp_welcomlist - thanks to Dominik for spotting it!
>
> src/PMG/Config.pm | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/src/PMG/Config.pm b/src/PMG/Config.pm
> index 2d2b6c83..f48c31dc 100644
> --- a/src/PMG/Config.pm
> +++ b/src/PMG/Config.pm
> @@ -1878,10 +1878,15 @@ sub rewrite_postfix_welcomelist {
> }
>
> my $changes = 0;
> - $changes ||= $write_smtp_welcomelist->("/etc/postfix/senderaccess", $fromlist);
> - $changes ||= $write_smtp_welcomelist->("/etc/postfix/rcptaccess", $tolist);
> - $changes ||= $write_smtp_welcomelist->("/etc/postfix/clientaccess", $clientlist);
> - $changes ||= $write_smtp_welcomelist->("/etc/postfix/postscreen_access", $clientlist, 'permit');
> + my $ret;
> + $ret = $write_smtp_welcomelist->("/etc/postfix/senderaccess", $fromlist);
> + $changes ||= $ret;
> + $ret = $write_smtp_welcomelist->("/etc/postfix/rcptaccess", $tolist);
> + $changes ||= $ret;
> + $ret = $write_smtp_welcomelist->("/etc/postfix/clientaccess", $clientlist);
> + $changes ||= $ret;
> + $ret = $write_smtp_welcomelist->("/etc/postfix/postscreen_access", $clientlist, 'permit');
> + $changes ||= $ret;
>
> return $changes;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* applied: [PATCH pmg-api v2] config: do not shortcircuit smtp-welcomelist generation
2026-06-09 9:03 [PATCH pmg-api v2] config: do not shortcircuit smtp-welcomelist generation Stoiko Ivanov
2026-06-09 9:11 ` Dominik Csapak
@ 2026-06-09 9:19 ` Stoiko Ivanov
1 sibling, 0 replies; 3+ messages in thread
From: Stoiko Ivanov @ 2026-06-09 9:19 UTC (permalink / raw)
To: pmg-devel, Stoiko Ivanov
Thanks for the quick turnaround and the feedback on this - I applied it
with your T-b, R-b.
On Tue, 09 Jun 2026 11:03:55 +0200, Stoiko Ivanov wrote:
> combining the results with ||= causes the write_smtp_welcomelist calls
> not to be run, after the first one signals a change.
> gather the combined changes in a different variable, to ensure each
> config-file is actually created/written, as postfix refuses to run if
> its config files are missing.
>
>
> [...]
Applied, thanks!
[1/1] config: do not shortcircuit smtp-welcomelist generation
commit: 17f17bced10341069add8a53a9466780b0129a38
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-09 9:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 9:03 [PATCH pmg-api v2] config: do not shortcircuit smtp-welcomelist generation Stoiko Ivanov
2026-06-09 9:11 ` Dominik Csapak
2026-06-09 9:19 ` applied: " Stoiko Ivanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox