variable expansion not working in $myauthservid definition?

jasonsu at mail-central.com jasonsu at mail-central.com
Thu Apr 7 20:37:38 CEST 2016



On Thu, Apr 7, 2016, at 11:10 AM, A. Schulze wrote:
> 
> jasonsu:
> 
> > 	$mydomain = 'mail01.example.com';
> > 	$myauthservid = 'amavisd.${$mydomain}';
> use double quotes to allow variable expansion.
> single quotes force use as literal string as you see...
> 
> -> $myauthservid = "amavisd.${$mydomain}";

If I switch

			my $mydomain = 'mail01.example.com';
			$myhostname = 'mail01.example.com';
	75	-	$myauthservid = 'amavisd.${$mydomain}';
		+	my $myauthservid = "amavisd.${$mydomain}";

I get an error on launch

	Error in config file "/etc/amavisd/amavisd.conf": Can't use string ("mail01.example.com") as a SCALAR ref while "strict refs" in use at /etc/amavisd/amavisd.conf line 75.

At the top of the config file I see

	use strict;

Do I get rid of the 'use strict', or change something in the config variable ?

And as for single- vs double- quote, what should these be then

	$smtpd_greeting_banner = '${$myhostname} ${protocol} ${product} service ready';
	$smtpd_quit_banner = '${$myhostname} ${product} closing transmission channel';

?

Jason



More information about the amavis-users mailing list