From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2DA576493A for ; Wed, 30 Dec 2020 14:07:36 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2B6FF223DA for ; Wed, 30 Dec 2020 14:07:36 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 6DB3D223D0 for ; Wed, 30 Dec 2020 14:07:35 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 36041446CB for ; Wed, 30 Dec 2020 14:07:35 +0100 (CET) Date: Wed, 30 Dec 2020 14:07:29 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: pmg-devel@lists.proxmox.com, Stoiko Ivanov References: <20201216171813.29694-1-s.ivanov@proxmox.com> <20201216171813.29694-5-s.ivanov@proxmox.com> In-Reply-To: <20201216171813.29694-5-s.ivanov@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1609333585.n039uwmz63.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.024 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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 4/4] pmg-daily: run sa-update for local channels 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: , X-List-Received-Date: Wed, 30 Dec 2020 13:07:36 -0000 On December 16, 2020 6:18 pm, Stoiko Ivanov wrote: > Signed-off-by: Stoiko Ivanov > --- > src/bin/pmg-daily | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) >=20 > diff --git a/src/bin/pmg-daily b/src/bin/pmg-daily > index 32ccb95..f5b0650 100755 > --- a/src/bin/pmg-daily > +++ b/src/bin/pmg-daily > @@ -73,12 +73,21 @@ if (my $http_proxy =3D $cfg->get('admin', 'http_proxy= ')) { > } > =20 > # update spamassassin rules > +my $restart_filter =3D 0; > if (system('sa-update') =3D=3D 0) { > # if the exit code is 0, new updates were downloaded > # then restart the pmg-smtp-filter to load the new rules > - PMG::Utils::service_cmd('pmg-smtp-filter', 'restart'); > + $restart_filter =3D 1; > } > =20 > +eval { > + $restart_filter ||=3D PMG::Utils::update_local_spamassassin_channels= (0); > +}; > +if (my $err =3D $@) { > + syslog('err', $err); > +} could just be syslog(..) if $@ > + > +PMG::Utils::service_cmd('pmg-smtp-filter', 'restart') if $restart_filter= ; > # run bayes database maintainance > system('sa-learn --force-expire >/dev/null 2>&1'); > =20 > --=20 > 2.20.1 >=20 >=20 >=20 > _______________________________________________ > pmg-devel mailing list > pmg-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel >=20 >=20 >=20 =