[pmg-devel] applied: [PATCH pmg-api 1/2] fall back to hostname only if no domain defined

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jun 17 10:56:46 CEST 2019


On 6/11/19 3:27 PM, Mira Limbeck wrote:
> fall back to hostname only if no domain is defined in /etc/resolv.conf.
> this removes the 'Use of uninitialized value' warning for
> '$msginfo->{domain}'.
> 
> Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
> ---
>  bin/pmg-smtp-filter | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/bin/pmg-smtp-filter b/bin/pmg-smtp-filter
> index d198239..a5bf246 100755
> --- a/bin/pmg-smtp-filter
> +++ b/bin/pmg-smtp-filter
> @@ -643,7 +643,8 @@ sub handle_smtp {
>  	my $resolv = PVE::INotify::read_file('resolvconf');
>  
>  	$msginfo->{domain} = $resolv->{search};
> -	$msginfo->{fqdn} = "$msginfo->{hostname}.$msginfo->{domain}";
> +	$msginfo->{fqdn} = $msginfo->{hostname};
> +	$msginfo->{fqdn} .= ".$msginfo->{domain}" if $msginfo->{domain};
>  	$msginfo->{lcid} = $lcid;
>  
>  	# $msginfo->{targets} is case sensitive,
> 

applied, thanks!



More information about the pmg-devel mailing list