Reply to: RE: digests not going out - A fix
Mats Dufberg wrote:
>On 6 Jan 2000, Pete Norton wrote:
>
>> $sender= $V{'ERRORS-TO'};
>> $mailcmd= eval qq/"$mailer"/;
>> system("$mailcmd $V{'REALLY-TO'} < $DIGEST");
>>
>> For some reason, the 'eval' command is adding a newline character to
the
>> end of the $mailcmd. The result is when the script sends the mail
command
>> to the system, the recipients are on a second line, and you get the
error
>> message.
>
>That sounds strange. How is $mailer defined?
You got me thinking, I thought I had checked $mailer and $sender, but I
guess I didn't. $mailer which is defined in both 'majordomo.cf' and in
the 'digest' script as
$mailer = "/usr/lib/sendmail -oi -oee -f\$sender
and
$sender = $V{'ERRORS-TO'}
which in turn
$V{'ERRORS-TO'} = $config_opts{$opt_l,"sender"} . "@" .
({$config_opts{$opts_l,"resend_host"}
|| $whereami);
The newline character comes from the $whereami which is defined in
'majordomo.cf' as
$whereami = '/bin/dnsdomainname'
Since in my digest list config file the 'resend_host' is undefined, the
the script uses $whereami and gets a newline character added. Defining
'resend_host in the config file fixes the problem.
How the newline characters got added in there I don't know.
>> The Perl experts will have to answer that one. A fix is to add the
>> following line to remove the newline character:
>>
>> $mailcmd= substr($mailcmd,0,-1);
>
>I would be safer to say
> chomp $mailcmd;
>because it would only remove trailing newlines, not any character. In
case
>you solve the real source of problem.
Thanks. What little Perl I know I picked up yesterday trying to solve
this problem. :-)
This isn't a bad add to the digest script anyway, since keeps the
unwanted newlines out.
-Pete Norton
pete.norton@orenco.com
Orenco Systems, Inc.
|
|