From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <s.ivanov@proxmox.com>
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 2222377781
 for <pmg-devel@lists.proxmox.com>; Wed, 28 Apr 2021 11:19:26 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id DC2F889F0
 for <pmg-devel@lists.proxmox.com>; Wed, 28 Apr 2021 11:19:25 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (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 E29A889F8
 for <pmg-devel@lists.proxmox.com>; Wed, 28 Apr 2021 11:19:23 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 447CE4294B
 for <pmg-devel@lists.proxmox.com>; Wed, 28 Apr 2021 11:13:24 +0200 (CEST)
Date: Wed, 28 Apr 2021 11:13:23 +0200
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: Fabian Ebner <f.ebner@proxmox.com>
Cc: pmg-devel@lists.proxmox.com
Message-ID: <20210428111323.1b419787@rosa.proxmox.com>
In-Reply-To: <20210428082250.30795-1-f.ebner@proxmox.com>
References: <20210428082250.30795-1-f.ebner@proxmox.com>
X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.017 Adjusted score from AWL reputation of From: address
 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] applied: [PATCH pmg-api] api: upload costum
 certificate: actually return info
X-BeenThere: pmg-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Mail Gateway development discussion
 <pmg-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pmg-devel>, 
 <mailto:pmg-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pmg-devel/>
List-Post: <mailto:pmg-devel@lists.proxmox.com>
List-Help: <mailto:pmg-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel>, 
 <mailto:pmg-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Wed, 28 Apr 2021 09:19:26 -0000

On Wed, 28 Apr 2021 10:22:50 +0200
Fabian Ebner <f.ebner@proxmox.com> wrote:

> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  src/PMG/API2/Certificates.pm | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/src/PMG/API2/Certificates.pm b/src/PMG/API2/Certificates.pm
> index c08deb6..1db4a90 100644
> --- a/src/PMG/API2/Certificates.pm
> +++ b/src/PMG/API2/Certificates.pm
> @@ -57,11 +57,13 @@ my sub update_cert : prototype($$$$$) {
>      my ($type, $cert_path, $certificate, $force, $restart) = @_;
>      my $code = sub {
>  	print "Setting custom certificate file $cert_path\n";
> -	PMG::CertHelpers::set_cert_file($certificate, $cert_path, $force);
> +	my $info = PMG::CertHelpers::set_cert_file($certificate, $cert_path, $force);
>  
>  	restart_after_cert_update($type) if $restart;
> +
> +	return $info;
>      };
> -    PMG::CertHelpers::cert_lock(10, $code);
> +    return PMG::CertHelpers::cert_lock(10, $code);
>  };
>  
>  my sub set_smtp : prototype($$) {
> @@ -250,7 +252,7 @@ __PACKAGE__->register_method ({
>  	my $info;
>  
>  	PMG::CertHelpers::cert_lock(10, sub {
> -	    update_cert($type, $cert_path, $certs, $param->{force}, $param->{restart});
> +	    $info = update_cert($type, $cert_path, $certs, $param->{force}, $param->{restart});
>  	});
>  
>  	if ($type eq 'smtp') {

Huge thanks for tracking this down and providing the patch!!
gave it a quick spin and applied it