From: Dominik Csapak <d.csapak@proxmox.com>
To: Stoiko Ivanov <s.ivanov@proxmox.com>, pmg-devel@lists.proxmox.com
Subject: Re: [PATCH pmg-api v2] config: do not shortcircuit smtp-welcomelist generation
Date: Tue, 9 Jun 2026 11:11:28 +0200 [thread overview]
Message-ID: <be0b2ce8-a10e-4f75-ba78-d42e2a01ad02@proxmox.com> (raw)
In-Reply-To: <20260609090517.828636-1-s.ivanov@proxmox.com>
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;
> }
next prev parent reply other threads:[~2026-06-09 9:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-06-09 9:19 ` applied: " Stoiko Ivanov
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=be0b2ce8-a10e-4f75-ba78-d42e2a01ad02@proxmox.com \
--to=d.csapak@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox