#!/bin/bash

#
# Change the next 'yes' to 'no' to enable this regular update.
# It is disabled by default as it may cause problems on your system.
# If your SpamAssassin stops finding spam after running this script,
# then you have the problem and should not use this script for now.
# Hopefully the SpamAssassin folks will fix this in their next release.
#

Disabled=yes;

if [ "x$Disabled" = "xyes" ]; then
  exit;
fi

# Insert a random delay up to this value, to spread virus updates round
# the clock. 1800 seconds = 30 minutes.
# Set this to 0 to disable it.
UPDATEMAXDELAY=3600
SAUPDATE=/usr/bin/sa-update
if [ -f /etc/sysconfig/MailScanner ] ; then
        . /etc/sysconfig/MailScanner
fi
export UPDATEMAXDELAY
export SAUPDATE

[ -x $SAUPDATE ] || exit 0
if [ "x$UPDATEMAXDELAY" = "x0" ]; then
  :
else
  logger -p mail.info -t sa-update Delaying cron job up to $UPDATEMAXDELAY seconds
  perl -e "sleep int(rand($UPDATEMAXDELAY));"
fi
exec $SAUPDATE
exit 0


syntax highlighted by Code2HTML, v. 0.9.1