rpms/spamassassin/F-12 .cvsignore, 1.56, 1.57 sa-update.cronscript, 1.5, 1.6 sa-update.crontab, 1.1, 1.2 sources, 1.55, 1.56 spamassassin.spec, 1.135, 1.136

Warren Togami 砥上勇 wtogami at fedoraproject.org
Thu Jan 14 22:42:41 UTC 2010


Author: wtogami

Update of /cvs/pkgs/rpms/spamassassin/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15177

Modified Files:
	.cvsignore sa-update.cronscript sa-update.crontab sources 
	spamassassin.spec 
Log Message:
- 3.3.0-rc3
- if mimedefang is enabled, reload rules after sa-update



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/spamassassin/F-12/.cvsignore,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -p -r1.56 -r1.57
--- .cvsignore	11 Jan 2010 19:54:07 -0000	1.56
+++ .cvsignore	14 Jan 2010 22:42:40 -0000	1.57
@@ -1,2 +1,2 @@
-Mail-SpamAssassin-3.3.0-rc2.tar.bz2
-Mail-SpamAssassin-rules-3.3.0-rc2.r898020.tgz
+Mail-SpamAssassin-3.3.0-rc3.tar.bz2
+Mail-SpamAssassin-rules-3.3.0-rc3.r899423.tgz


Index: sa-update.cronscript
===================================================================
RCS file: /cvs/pkgs/rpms/spamassassin/F-12/sa-update.cronscript,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- sa-update.cronscript	25 Sep 2009 04:15:56 -0000	1.5
+++ sa-update.cronscript	14 Jan 2010 22:42:41 -0000	1.6
@@ -1,22 +1,84 @@
 #!/bin/bash
 # *** DO NOT MODIFY THIS FILE ***
-# Edit /etc/cron.d/sa-update to enable nightly automatic updates
-# /etc/mail/spamassassin/sa-update-channels.txt 
-#     Specify custom channels here
-# /etc/mail/spamassassin/sa-update-keys.txt
-#     Specify trusted GPG keys for custom channels here
+#
+# /etc/mail/spamassassin/channel.d/*.conf
+#     Place files here to add custom channels.
+#
 
-# Sleep random amount of time before proceeding to avoid overwhelming the servers
-sleep $(expr $RANDOM % 7200)
+# 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
+[ -f /etc/sysconfig/sa-update ] && . /etc/sysconfig/sa-update
+for daemon in spamd amavisd; do
+    /sbin/pidof $daemon >& /dev/null
+    [ $? -eq 0 ] && SAUPDATE=yes
+done
+[ -f /var/run/mimedefang.pid ] && SAUPDATE=yes
+
+# Skip sa-update if daemon not detected
+[ -z "$SAUPDATE" ] && exit 0
 
 # 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/channel.d/
+for file in $(run_parts_list /etc/mail/spamassassin/channel.d/ .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
+    [ -f /var/run/mimedefang.pid ] && /etc/init.d/mimedefang reload > /dev/null
+fi


Index: sa-update.crontab
===================================================================
RCS file: /cvs/pkgs/rpms/spamassassin/F-12/sa-update.crontab,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sa-update.crontab	14 Dec 2006 20:36:20 -0000	1.1
+++ sa-update.crontab	14 Jan 2010 22:42:41 -0000	1.2
@@ -1,9 +1,12 @@
-### OPTIONAL: Spamassassin Rules Updates ###
+# *** DO NOT MODIFY THIS FILE ***
+### Spamassassin Rules Updates ###
 #
 # http://wiki.apache.org/spamassassin/RuleUpdates
-# Highly recommended that you read the documentation before using this.
-# ENABLE UPDATES AT YOUR OWN RISK.
+# 
+# sa-update automatically updates your rules once per day if a spam daemon like
+# spamd or amavisd are running.  You can force sa-update to run in
+# /etc/sysconfig/sa-update
 #
 # /var/log/sa-update.log contains a history log of sa-update runs
 
-#10 4 * * * root /usr/share/spamassassin/sa-update.cron 2>&1 | tee -a /var/log/sa-update.log
+10 4 * * * root /usr/share/spamassassin/sa-update.cron 2>&1 | tee -a /var/log/sa-update.log


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/spamassassin/F-12/sources,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -p -r1.55 -r1.56
--- sources	11 Jan 2010 19:54:07 -0000	1.55
+++ sources	14 Jan 2010 22:42:41 -0000	1.56
@@ -1,2 +1,2 @@
-a3b39bb31d0c41d7e89450599374c7c9  Mail-SpamAssassin-3.3.0-rc2.tar.bz2
-c3685302eeae5fd75bc05145b4145881  Mail-SpamAssassin-rules-3.3.0-rc2.r898020.tgz
+02173a0bc83f945181f5b22759a59598  Mail-SpamAssassin-3.3.0-rc3.tar.bz2
+cbaae6d124b8bb5597903eac8fc58c11  Mail-SpamAssassin-rules-3.3.0-rc3.r899423.tgz


Index: spamassassin.spec
===================================================================
RCS file: /cvs/pkgs/rpms/spamassassin/F-12/spamassassin.spec,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -p -r1.135 -r1.136
--- spamassassin.spec	11 Jan 2010 19:54:07 -0000	1.135
+++ spamassassin.spec	14 Jan 2010 22:42:41 -0000	1.136
@@ -51,13 +51,13 @@ Requires: portreserve
 Summary: Spam filter for email which can be invoked from mail delivery agents
 Name: spamassassin
 Version: 3.3.0
-%define prename rc2
-Release: 0.30.%{prename}%{?dist}
+%define prename rc3
+Release: 0.32.%{prename}%{?dist}
 License: ASL 2.0
 Group: Applications/Internet
 URL: http://spamassassin.apache.org/
 Source0: http://www.apache.org/dist/%{name}/%{real_name}-%{version}-%{prename}.tar.bz2
-Source1: Mail-SpamAssassin-rules-3.3.0-rc2.r898020.tgz
+Source1: Mail-SpamAssassin-rules-3.3.0-rc3.r899423.tgz
 Source2: redhat_local.cf
 Source3: spamassassin-default.rc
 Source4: spamassassin-spamc.rc
@@ -201,9 +201,9 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir
 
 # sa-update channels and keyring directory
 mkdir   -m 0700             $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/
+mkdir   -m 0755             $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channel.d/
+install -m 0644 %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channel.d/
+install -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/channel.d/
 
 # Tell portreserve which port we want it to protect.
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/portreserve
@@ -261,11 +261,15 @@ fi
 exit 0
 
 %changelog
-* Mon Jan 11 2010 Warren Togami <wtogami at redhat.com> - 3.3.0-0.30-rc2
+* Thu Jan 14 2010 Warren Togami <wtogami at redhat.com> - 3.3.0-0.32-rc3
+- 3.3.0-rc3
+- if mimedefang is enabled, reload rules after sa-update
+
+* Mon Jan 11 2010 Warren Togami <wtogami at redhat.com> - 3.3.0-0.31-rc2
 - 3.3.0-rc2
 
 * Mon Dec 28 2009 Warren Togami <wtogami at redhat.com> - 3.3.0-0.29.rc1
-- sa-update channels defined in /etc/mail/spamassassin/channels/*.conf
+- sa-update channels defined in /etc/mail/spamassassin/channel.d/*.conf files
 
 * Mon Dec 28 2009 Warren Togami <wtogami at redhat.com> - 3.3.0-0.27.rc1
 - sa-update runs in cron automatically if spamd or amavisd is running
@@ -274,10 +278,6 @@ exit 0
 * Mon Dec 21 2009 Warren Togami <wtogami at redhat.com> - 3.3.0-0.26.rc1
 - 3.3.0-rc1.proposed2 with fixed spamc
 
-* Mon Dec 21 2009 Nick Bebout <nb at fedoraproject.org> - 3.3.0-0.24.beta1
-- Revert to beta1 to fix major error where spamc does nothing and mail
-  is lost into black hole.
-
 * Fri Dec 18 2009 Warren Togami <wtogami at redhat.com> - 3.3.0-0.23.rc1
 - 3.3.0-rc1
 - Bug #103401: portreserve protect spamd port 783 on F-10+



More information about the scm-commits mailing list