sa-update channels defined in /etc/mail/spamassassin/channels/*.conf

This commit is contained in:
Warren Togami 2009-12-29 03:18:05 +00:00
parent 1fbc04e571
commit b0a6ba11ba
6 changed files with 164 additions and 25 deletions

View File

@ -1,2 +0,0 @@
updates.spamassassin.org
sought.rules.yerp.org

View File

@ -1,2 +0,0 @@
# SOUGHT anti-fraud ruleset
6C6191E3

View File

@ -1,11 +1,31 @@
#!/bin/bash
# *** DO NOT MODIFY THIS FILE ***
#
# /etc/mail/spamassassin/sa-update-channels.txt
# Specify custom channels here
# /etc/mail/spamassassin/channels/*.conf
# Place files here to add custom channels.
#
# /etc/mail/spamassassin/sa-update-keys.txt
# Specify trusted GPG keys for custom channels here
# list files in a directory consisting only of alphanumerics, hyphens and
# underscores
# $1 - directory to list
# $2 - optional suffix to limit which files are selected
run_parts_list() {
if [ $# -lt 1 ]; then
echo "ERROR: Usage: run_parts_list <dir>" > /dev/stderr
exit 1
fi
if [ ! -d "$1" ]; then
echo "ERROR: Not a directory: $1" > /dev/stderr
exit 1
fi
if [ -d "$1" ]; then
if [ -n "$2" ]; then
find_opts='-name *'$2
fi
find -L $1 -mindepth 1 -maxdepth 1 -type f $find_opts | sort -n
fi
}
# Proceed with sa-update if spam daemon is running or forced in /etc/sysconfig/sa-update
unset SAUPDATE
@ -18,17 +38,45 @@ done
# Skip sa-update if daemon not detected
[ -z "$SAUPDATE" ] && exit 0
# Sleep random amount of time before proceeding to avoid overwhelming the servers
sleep $(expr $RANDOM % 7200)
# sa-update must create keyring
if [ ! -d /etc/mail/spamassassin/sa-update-keys ]; then
sa-update
fi
# Import SOUGHT key
sa-update --import /usr/share/spamassassin/sought-pubkey.txt
# Update rules with sa-update, restart spamd if rules were updated
/usr/bin/sa-update --channelfile /etc/mail/spamassassin/sa-update-channels.txt \
--gpgkeyfile /etc/mail/spamassassin/sa-update-keys.txt && \
/etc/init.d/spamassassin condrestart > /dev/null
# Initialize Channels and Keys
CHANNELLIST=""
KEYLIST=""
# Process each channel defined in /etc/mail/spamassassin/channels/
for file in $(run_parts_list /etc/mail/spamassassin/channels/ .conf); do
# Validate config file
PREFIXES="CHANNELURL KEYID BEGIN"
for prefix in $PREFIXES; do
if ! grep -q "$prefix" $file; then
echo "ERROR: $file missing $prefix"
exit 255
fi
done
. $file
echo "CHANNELURL=$CHANNELURL"
echo "KEYID=$KEYID"
CHANNELLIST="$CHANNELLIST $CHANNELURL"
KEYLIST="$KEYLIST $KEYID"
sa-update --import $file
done
# Sleep random amount of time before proceeding to avoid overwhelming the servers
sleep $(expr $RANDOM % 7200)
unset arglist
# Run sa-update on each channel, restart spam daemon if success
for channel in $CHANNELLIST; do
arglist="$arglist --channel $channel"
done
for keyid in $KEYLIST; do
arglist="$arglist --gpgkey $keyid"
done
/usr/bin/sa-update $arglist
if [ $? -eq 0 ]; then
/etc/init.d/spamassassin condrestart > /dev/null
[ -f /etc/init.d/amavisd ] && /etc/init.d/amavisd condrestart > /dev/null
fi

View File

@ -1,3 +1,9 @@
# http://wiki.apache.org/spamassassin/SoughtRules
CHANNELURL=sought.rules.yerp.org
KEYID=6C6191E3
# Ignore everything below.
return 0
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.1 (GNU/Linux)

View File

@ -0,0 +1,86 @@
# http://wiki.apache.org/spamassassin/RuleUpdates
CHANNELURL=updates.spamassassin.org
KEYID=5244EC45
# Ignore everything below.
return 0
This is the GPG key that updates are signed with (currently,
as of Wed Dec 21 19:31:38 PST 2005. Please contact <dev /at/
spamassassin.apache.org> with any questions.
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2 (SunOS)
mQILBEOnbDQBEADBfda+hU8cGXD/2WYrIHsZ5CmvC2eCYKgQ87W706tzwmxoZWQS
JfnRpkZnBqS5WDhXhNBOhk9CgF5/e9yHnDQCusNYfRstKd+t0XTFvq30/tacrJNe
67zgq+DtWqIK9C7akfElc+2M5NkX6mF4cjaMXZoW17ltPy0XSSeirf584nvK3pXf
oEFLYQ/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C81ywQ
aB8EKy5bg4U6
=IbYW
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -55,7 +55,7 @@ Name: spamassassin
Version: 3.3.0
%define prename rc1
%define proposed .proposed2
Release: 0.27.%{prename}%{?dist}
Release: 0.28.%{prename}%{?dist}
License: ASL 2.0
Group: Applications/Internet
URL: http://spamassassin.apache.org/
@ -70,9 +70,8 @@ Source7: sa-update.crontab
Source8: sa-update.cronscript
Source9: sa-update.force-sysconfig
Source10: spamassassin-helper.sh
Source11: sa-update-channels.txt
Source12: sa-update-keys.txt
Source13: sought-pubkey.txt
Source11: spamassassin-official.conf
Source12: sought.conf
# Patches 0-99 are RH specific
# none yet
# Patches 100+ are SVN backports (DO NOT REUSE!)
@ -178,7 +177,6 @@ install -m 0644 %{SOURCE7} %buildroot/etc/cron.d/sa-update
install -m 0644 %{SOURCE9} %buildroot%{_sysconfdir}/sysconfig/sa-update
# installed mode 744 as non root users can't run it, but can read it.
install -m 0744 %{SOURCE8} %buildroot%{_datadir}/spamassassin/sa-update.cron
install -m 0644 %{SOURCE13} %buildroot%{_datadir}/spamassassin/
[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress
@ -204,9 +202,11 @@ find $RPM_BUILD_ROOT%{perl_vendorlib}/* -type d -print |
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/spamassassin
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/spamassassin
# sa-update channels and keys
install -m 0644 %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/
install -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/
# sa-update channels and keyring directory
mkdir -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/sa-update-keys/
mkdir -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channels/
install -m 0644 %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channels/
install -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channels/
# Tell portreserve which port we want it to protect.
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/portreserve
@ -264,6 +264,9 @@ fi
exit 0
%changelog
* Mon Dec 28 2009 Warren Togami <wtogami@redhat.com> - 3.3.0-0.28.rc1
- sa-update channels defined in /etc/mail/spamassassin/channels/*.conf
* Mon Dec 28 2009 Warren Togami <wtogami@redhat.com> - 3.3.0-0.27.rc1
- sa-update runs in cron automatically if spamd or amavisd is running
If you use neither, you may force sa-update by editing /etc/sysconfig/sa-update.