Fwd: a bug in processing MAILTO config and environment

"Kirk Bauer" <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
One more -- not sure if this is fixed in newer versions, but I know we
have had some confusion in this area so it might be applicable.


---------- Forwarded message ----------
From: Hameedullah Khan <[email protected]>
Date: Tue, Feb 12, 2008 at 9:04 AM
Subject: a bug in processing MAILTO config and environment
To: [email protected]


Logwatch 7.3.4 works as follows:

 ogwatch reads ENV variable on line 82,

 then on line 298 it reads configuration file,

 then below that it processes command line arguments.

 So its clear on fedora 7 logwatch processes mailto variable in different
 order. First the ENV variable is read and then the script read config
 file and override it if there is one specified in config file.


 Logwatch 7.3.6 works as follows:

 logwatch script reads config file on line 290.


 Then logwatch script read command line options on line 328.


 Then on line 362 logwatch script reads ENV variable MAILTO and set
 mailto to ENV variable



 Then on line 389 it sets mailto to the one provided on command line if any.



 So here is my conclusion, the logwatch 7.3.6 script processes mailto
as follows:

 1. first read mailto from the config file
 2. then override it if there is and ENV variable MAILTO
 3. then override it if there is one specified on command line.


 So, in logwatch 3.4.6 the functionality have been changed as we were
 using MAILTO config variable for mailing our logwatch emails to
 different emails on fedora 7 which had 7.3.4. But suddenly after
 upgrate to Fedora 8 which comes with 7.3.6 it stopped working and the
 above is the result of analysis of that. Because there is default
 MAILTO env variable is specified in /etc/crontab.

 --
 Hameedullah Khan




-- 
Kirk Bauer <[email protected]>
http://linux.kaybee.org | www.logwatch.org
Author, Automating UNIX & Linux Administration
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.