You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Thomas Harold <th...@nybeta.com> on 2010/01/05 20:16:22 UTC

Re: Apache SpamAssassin Y2K10 Rule Bug - Update Your Rules Now! (custom sa-update script from howtoforge)

On 1/5/2010 1:50 PM, Larry Starr wrote:
> On Tuesday 05 January 2010, Thomas Harold wrote:
>>
>> You mean something more then:
>>
>> "An update was available, and was downloaded and installed successfully.
>> You are now running sa-update version svn607589."
>>
>> Which is the message generated by sa-update on my system, packed up into
>> an e-mail to the root user when it runs daily.  I think it's a standard
>> script that is part of SA...
>>
>> If you want to know specifically what changed on the server - maybe a
>> tripwire setup or use FSVS and version the entire server (well, except
>> for stuff that doesn't need to be versioned like user data).  On our
>> setup, after running sa-update, I could use FSVS to get a list of what
>> files have changed and even do a diff between the old/new versions.
>
> That message would be helpful, my sa-update seems to produce no output,
> regardless of the presense or absense of updates. I am running version
> svn607589, per the Version option of sa-update:
>
> sa-update --version
> sa-update version svn607589
>    running on Perl version 5.10.0
>
> Apparently it is necessary to place sa-update in a wrapper script to generate
> such output?
>

Well, looking at the SA install on my CentOS 5 x86_64 server...

/etc/cron.d/sa-update
- This file was installed by the RPM, but the only entry is commented out.

I'm using a custom shell script (spamassassin_sa-update.sh) which gets 
run by root's daily crontab.

#!/bin/sh

echo "Running sa-update to update SpamAssassin rules..."

#Today's date
today=$(date +%Y-%m-%d)

#Run sa-update
/usr/bin/sa-update
exitcode=$? #Exit code from sa-update

#Find version of sa-update
version=$(/usr/bin/sa-update -V | grep "sa-update")

if [ $exitcode = 0 ]; then
     echo "An update was available, and was downloaded and installed 
successfully. You are now running $version." | mail -s "sa-update for 
$today - Updated" root
     echo "Updated to $version."
elif [ $exitcode = 1 ]; then
     echo "No update was available. You are still running $version."  | 
mail -s "sa-update for $today - No Update" root
     echo "No update today."
else
     echo "An error occured while attempting to download and extract 
updates. You are still running $version." | mail -s "sa-update for 
$today - ERROR" root
     echo "Error occurred."
fi

echo "End of /usr/local/sbin/spamassassin_sa-update.sh"
exit 0

I'm not sure where I picked up that script.  Probably from the following 
link:

http://www.howtoforge.com/forums/showthread.php?t=10710

Re: Apache SpamAssassin Y2K10 Rule Bug - Update Your Rules Now! (custom sa-update script from howtoforge)

Posted by Bowie Bailey <Bo...@BUC.com>.
Mark Martinec wrote:
> On Tuesday January 5 2010 22:47:42 Bowie Bailey wrote:
>   
>> I patched sa-update to add a verbose option which outputs all the
>> channel names that had changes.  Very simple patch if anyone is
>> interested.  It installs cleanly on 3.2.5, I haven't tried 3.3.
>>     
>
> This looks like an useful small patch.
> Could you please open an enhancement request on the Bugzilla.
>   

Done.

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6277

-- 
Bowie

Re: Apache SpamAssassin Y2K10 Rule Bug - Update Your Rules Now! (custom sa-update script from howtoforge)

Posted by Mark Martinec <Ma...@ijs.si>.
On Tuesday January 5 2010 22:47:42 Bowie Bailey wrote:
> I patched sa-update to add a verbose option which outputs all the
> channel names that had changes.  Very simple patch if anyone is
> interested.  It installs cleanly on 3.2.5, I haven't tried 3.3.

This looks like an useful small patch.
Could you please open an enhancement request on the Bugzilla.

  Mark

Re: Apache SpamAssassin Y2K10 Rule Bug - Update Your Rules Now! (custom sa-update script from howtoforge)

Posted by Bowie Bailey <Bo...@BUC.com>.
Larry Starr wrote:
> From my install there is a "/etc/cron.daily/spamassassin" which I'm not using, 
> that provides none of that information.
>
> I believe I will have to implement a wrapper script to, at least, notify me 
> when updates have been applied.
>   

I patched sa-update to add a verbose option which outputs all the
channel names that had changes.  Very simple patch if anyone is
interested.  It installs cleanly on 3.2.5, I haven't tried 3.3.

-- 
Bowie



Re: Apache SpamAssassin Y2K10 Rule Bug - Update Your Rules Now! (custom sa-update script from howtoforge)

Posted by Larry Starr <la...@fullcompass.com>.
On Tuesday 05 January 2010, Thomas Harold wrote:
> On 1/5/2010 1:50 PM, Larry Starr wrote:
> > On Tuesday 05 January 2010, Thomas Harold wrote:
> >> You mean something more then:
> >>
> >> "An update was available, and was downloaded and installed successfully.
> >> You are now running sa-update version svn607589."
> >>
> >> Which is the message generated by sa-update on my system, packed up into
> >> an e-mail to the root user when it runs daily.  I think it's a standard
> >> script that is part of SA...
> >>
> >> If you want to know specifically what changed on the server - maybe a
> >> tripwire setup or use FSVS and version the entire server (well, except
> >> for stuff that doesn't need to be versioned like user data).  On our
> >> setup, after running sa-update, I could use FSVS to get a list of what
> >> files have changed and even do a diff between the old/new versions.
> >
> > That message would be helpful, my sa-update seems to produce no output,
> > regardless of the presense or absense of updates. I am running version
> > svn607589, per the Version option of sa-update:
> >
> > sa-update --version
> > sa-update version svn607589
> >    running on Perl version 5.10.0
> >
> > Apparently it is necessary to place sa-update in a wrapper script to
> > generate such output?
>
> Well, looking at the SA install on my CentOS 5 x86_64 server...
>
> /etc/cron.d/sa-update
> - This file was installed by the RPM, but the only entry is commented out.
>
> I'm using a custom shell script (spamassassin_sa-update.sh) which gets
> run by root's daily crontab.
>
> #!/bin/sh
>
> echo "Running sa-update to update SpamAssassin rules..."
>
> #Today's date
> today=$(date +%Y-%m-%d)
>
> #Run sa-update
> /usr/bin/sa-update
> exitcode=$? #Exit code from sa-update
>
> #Find version of sa-update
> version=$(/usr/bin/sa-update -V | grep "sa-update")
>
> if [ $exitcode = 0 ]; then
>      echo "An update was available, and was downloaded and installed
> successfully. You are now running $version." | mail -s "sa-update for
> $today - Updated" root
>      echo "Updated to $version."
> elif [ $exitcode = 1 ]; then
>      echo "No update was available. You are still running $version."  |
> mail -s "sa-update for $today - No Update" root
>      echo "No update today."
> else
>      echo "An error occured while attempting to download and extract
> updates. You are still running $version." | mail -s "sa-update for
> $today - ERROR" root
>      echo "Error occurred."
> fi
>
> echo "End of /usr/local/sbin/spamassassin_sa-update.sh"
> exit 0
>
> I'm not sure where I picked up that script.  Probably from the following
> link:
>
> http://www.howtoforge.com/forums/showthread.php?t=10710

Thank you

From my install there is a "/etc/cron.daily/spamassassin" which I'm not using, 
that provides none of that information.

I believe I will have to implement a wrapper script to, at least, notify me 
when updates have been applied.


-- 
Larry G. Starr - larrys@fullcompass.com or starrl@globaldialog.com
Software Engineer: Full Compass Systems LTD.
Phone: 608-831-7330 x 1347  FAX: 608-831-6330
===================================================================
There are only three sports: bullfighting, mountaineering and motor
racing, all the rest are merely games! - Ernest Hemmingway