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 7E3451FF16B for ; Fri, 26 Sep 2025 21:29:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D8EA8178B6; Fri, 26 Sep 2025 21:29:50 +0200 (CEST) From: Stoiko Ivanov To: pmg-devel@lists.proxmox.com Date: Fri, 26 Sep 2025 21:27:12 +0200 Message-ID: <20250926192941.89086-6-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250926192941.89086-1-s.ivanov@proxmox.com> References: <20250926192941.89086-1-s.ivanov@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1758914969205 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.073 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: [pmg-devel] [PATCH pmg-api v3 3/3] api: fetchmail: restart fetchmail on config changes 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" Based on feedback from Max (big Thanks!) in: https://lore.proxmox.com/pmg-devel/DD2PXG51NFKF.2D5G45FY3K66F@proxmox.com/T/#t The handling of fetchmail config can probably still be improved, but restarting the daemon, when something changes (it was the easiest way I found to get fetchmail to re-read its config) should improve UX quite a bit. IIRC currently changing the config still requires restarting fetchmail on the commandline (or rebooting). Signed-off-by: Stoiko Ivanov --- src/PMG/API2/Fetchmail.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PMG/API2/Fetchmail.pm b/src/PMG/API2/Fetchmail.pm index d90c016e..d94b5f52 100644 --- a/src/PMG/API2/Fetchmail.pm +++ b/src/PMG/API2/Fetchmail.pm @@ -203,6 +203,7 @@ __PACKAGE__->register_method({ $fmcfg->{$id} = $entry; PVE::INotify::write_file('fetchmailrc', $fmcfg); + PMG::Utils::service_cmd('fetchmail', 'restart') }; PMG::Config::lock_config($code, "update fechtmail configuration failed"); @@ -242,6 +243,7 @@ __PACKAGE__->register_method({ } PVE::INotify::write_file('fetchmailrc', $fmcfg); + PMG::Utils::service_cmd('fetchmail', 'restart') }; PMG::Config::lock_config($code, "update fechtmail configuration failed"); @@ -280,6 +282,7 @@ __PACKAGE__->register_method({ delete $fmcfg->{$id}; PVE::INotify::write_file('fetchmailrc', $fmcfg); + PMG::Utils::service_cmd('fetchmail', 'restart') }; PMG::Config::lock_config($code, "delete fechtmail configuration failed"); -- 2.47.3 _______________________________________________ pmg-devel mailing list pmg-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel