From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 622D11FF15D for ; Thu, 3 Oct 2024 17:27:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A017130E99; Thu, 3 Oct 2024 17:28:08 +0200 (CEST) Message-ID: Date: Thu, 3 Oct 2024 17:27:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Stoiko Ivanov , pmg-devel@lists.proxmox.com References: <20241002172238.20947-1-s.ivanov@proxmox.com> Content-Language: en-GB From: Thomas Lamprecht In-Reply-To: <20241002172238.20947-1-s.ivanov@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.050 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pmg-devel] [PATCH pmg-api] sa-custom: fix moving config across mountpoints X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pmg-devel-bounces@lists.proxmox.com Sender: "pmg-devel" On 02/10/2024 19:22, Stoiko Ivanov wrote: > the custom scores are kept in /var/cache/pmg-scores.cf, until they are > applied, by moving them to /etc/mail/spamassassin/pmg-scores.cf. Is there a good reason to not keep them in "/etc/mail/spamassassin/" instead? That would ensure a simple rename can work and be IMO a bit more in line with what we do else where (like host network changes), and using "/var/cache" here feels also a bit odd in general, but that doesn't have to be the deciding factor. I'm fine with switching to move, but IMO adding a short info for why not changing the pending changes config file path to the same directory might be warranted. > @@ -14,7 +15,9 @@ sub get_shadow_path { > } > > sub apply_changes { > - rename($shadow_path, $conf_path) if -f $shadow_path; > + if (-f $shadow_path) { > + move($shadow_path, $conf_path) || die 'Moving custom scores configuration failed!\n'; is there no error variable? With rename we could at least do if (-f $shadow_path) { rename($shadow_path, $conf_path) or die "failed to apply custom scores - $!\n"; } (which would have made exposing that bug much easier in the first place ^^) > + } > } > > sub calc_digest { _______________________________________________ pmg-devel mailing list pmg-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel