Great Circle Associates Majordomo-Users
(January 2000)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: RE: digests not going out - A fix
From: Pete Norton <pete . norton @ orenco . com>
Date: 06 Jan 00 13:47:43 -0800
To: Mats Dufberg <Mats . Dufberg @ abc . se>
Cc: "Bradfield, Chris" <chris @ onehouse . com>, "majordomo-users" <majordomo-users @ greatcircle . com>
Reply-to: Pete Norton <pete . norton @ orenco . com>

         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.





Indexed By Date Previous: Dating Nomail
From: Bob Creech <bobkansas@earthlink.net>
Next: Returned mail: Service unavailable (fwd)
From: Robert Lumley <rlumley@telmaron.com>
Indexed By Thread Previous: RE: digests not going out - A fix
From: Mats Dufberg <Mats.Dufberg@abc.se>
Next: RE: digests not going out - A fix
From: Mats Dufberg <Mats.Dufberg@abc.se>

Google
 
Search Internet Search www.greatcircle.com