Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

spam assassin rules update

240 views
Skip to first unread message

Nikolaos Milas

unread,
Sep 28, 2012, 5:08:56 AM9/28/12
to
Hello,

I am on CentOS 6.3, using: amavisd-new-2.8.0-1.el6.x86_64 (which I built
using the RPMForge SRPM for amavis 2.6.6 and current amavis source release).

Installed/used:
---------------
spamassassin-3.3.1-2.el6.x86_64
clamav-db-0.97.6-1.el6.rf.x86_64
clamd-0.97.6-1.el6.rf.x86_64
clamav-0.97.6-1.el6.rf.x86_64

(Clamd is running, spamd is not - since SA is controlled by amavis.)

My question: I don't see any activity to update spamassassin rules. In
/etc/sysconfig/sa-update I see:

# Uncomment below to force nightly sa-update
# (you don't need to do this if you use spamd or amavisd)

#SAUPDATE=yes

So, I would expect that amavis would somehow take care of SA rule
updates, but I don't see any.

I even tried to run:

# /usr/share/spamassassin/sa-update.cron 2>&1 | tee -a
/var/log/sa-update.log

as described in /etc/cron.d/sa-update, but I only get:

# tail -f /var/log/sa-update.log
./sa-update: line 12: 10: command not found

I could not find any problem in the script that would cause an error.

Also:
-----
# amavisd debug-sa
Sep 28 12:05:09.540 mailgate.example.com /usr/sbin/amavisd[19002]:
logging initialized, log level 2, syslog: amavis.local6
Sep 28 12:05:09.554 mailgate.example.com /usr/sbin/amavisd[19002]: Valid
PID file (younger than sys uptime 1 21:12:00)
Sep 28 12:05:09.556 mailgate.example.com /usr/sbin/amavisd[19002]: The
amavisd daemon is already running, PID: [18601]
The amavisd daemon is already running, PID: [18601]

Can you please advise on the issue? How can I enable SA rule updates?

Thanks,
Nick

Birta Levente

unread,
Sep 28, 2012, 5:26:48 AM9/28/12
to
On 28/09/2012 12:08, Nikolaos Milas wrote:
> Hello,
>
> I am on CentOS 6.3, using: amavisd-new-2.8.0-1.el6.x86_64 (which I built
> using the RPMForge SRPM for amavis 2.6.6 and current amavis source
> release).
>
> Installed/used:
> ---------------
> spamassassin-3.3.1-2.el6.x86_64
> clamav-db-0.97.6-1.el6.rf.x86_64
> clamd-0.97.6-1.el6.rf.x86_64
> clamav-0.97.6-1.el6.rf.x86_64
>
> (Clamd is running, spamd is not - since SA is controlled by amavis.)
>
> My question: I don't see any activity to update spamassassin rules. In
> /etc/sysconfig/sa-update I see:
>
> # Uncomment below to force nightly sa-update
> # (you don't need to do this if you use spamd or amavisd)
>
> #SAUPDATE=yes
>
> So, I would expect that amavis would somehow take care of SA rule
> updates, but I don't see any.
>


No, amavisd not take care about updates. Normally is done by cron job.


> I even tried to run:
>
> # /usr/share/spamassassin/sa-update.cron 2>&1 | tee -a
> /var/log/sa-update.log


Show us, the sa-update.cron

Nikolaos Milas

unread,
Sep 28, 2012, 5:46:13 AM9/28/12
to
On 28/9/2012 12:26 μμ, Birta Levente wrote:

> Show us, the sa-update.cron

Thanks for the reply.

Here it is:

# cat /usr/share/spamassassin/sa-update.cron
========================================================================================
#!/bin/bash
# *** DO NOT MODIFY THIS FILE ***
#
# /etc/mail/spamassassin/channel.d/*.conf
# Place files here to add custom channels.
#

# 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

# Initialize Channels and Keys
CHANNELLIST=""
KEYLIST=""
# Process each channel defined in /etc/mail/spamassassin/channel.d/
for file in /etc/mail/spamassassin/channel.d/*.conf; do
[ ! -f "$file" ] && continue
# 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
/sbin/service spamassassin condrestart > /dev/null
[ -f /etc/init.d/amavisd ] && /sbin/service amavisd condrestart > /dev/null
[ -f /var/run/mimedefang.pid ] && /sbin/service mimedefang reload >
/dev/null
fi

========================================================================================

Birta Levente

unread,
Sep 28, 2012, 6:42:11 AM9/28/12
to
Upps ... I take another look on your first mail ... so you need to show
us the 12 line from sa-update script.

Nikolaos Milas

unread,
Sep 28, 2012, 7:37:07 AM9/28/12
to
On 28/9/2012 1:42 μμ, Birta Levente wrote:

> Upps ... I take another look on your first mail ... so you need to
> show us the 12 line from sa-update script.

I don't see anything useful there. But the following might provide the
info you want:

# cat -n /usr/bin/sa-update | head -n30
1 #!/usr/bin/perl -T -w
2
3 eval 'exec /usr/bin/perl -T -w -S $0 ${1+"$@"}'
4 if 0; # not running under some shell
5
6 # <@LICENSE>
7 # Licensed to the Apache Software Foundation (ASF) under one or
more
8 # contributor license agreements. See the NOTICE file
distributed with
9 # this work for additional information regarding copyright
ownership.
10 # The ASF licenses this file to you under the Apache License,
Version 2.0
11 # (the "License"); you may not use this file except in
compliance with
12 # the License. You may obtain a copy of the License at:
13 #
14 # http://www.apache.org/licenses/LICENSE-2.0
15 #
16 # Unless required by applicable law or agreed to in writing,
software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied.
19 # See the License for the specific language governing
permissions and
20 # limitations under the License.
21 # </@LICENSE>
22
23 my $VERSION = 'svn' . (split(/\s+/,
24 '$Id: sa-update.raw 917659 2010-03-01 19:24:41Z
mmartinec $'))[2];
25
26 my $PREFIX = '/usr'; # substituted at
'make' time
27 my $DEF_RULES_DIR = '/usr/share/spamassassin'; #
substituted at 'make' time
28 my $LOCAL_RULES_DIR = '/etc/mail/spamassassin'; #
substituted at 'make' time
29 my $LOCAL_STATE_DIR = '/var/lib/spamassassin'; # substituted
at 'make' time
30 use lib '/usr/share/perl5'; # substituted at
'make' time

Regards,
Nick

Birta Levente

unread,
Sep 28, 2012, 8:12:50 AM9/28/12
to
Me neither :)

Have you tried to run sa-update manually (not the sa-update.cron)? Use
-D to be verbose:
#sa-update -D

What you see?

Nikolaos Milas

unread,
Sep 28, 2012, 8:41:09 AM9/28/12
to
On 28/9/2012 12:08 μμ, Nikolaos Milas wrote:

> # tail -f /var/log/sa-update.log
> ./sa-update: line 12: 10: command not found

It seems that this output is left from an older run (and I don't know
how it came up).

In all recent runs, it seems there is no output at all.

When I run simply "/usr/bin/sa-update -D", everything seems to run smoothly.

So, I would guess something is wrong in
/usr/share/spamassassin/sa-update.cron which does not allow proper updates.

Nick

John Hinton

unread,
Sep 28, 2012, 11:02:33 AM9/28/12
to
I had an issue where the server contacted was not responding last week.
I was getting failed cronjob emails. It went away somewhere in the last
several days. Sorry to not have specific times, dates and server name.
Maybe you are seeing the residual from this?

--
John Hinton
877-777-1407 ext 502
http://www.ew3d.com
Comprehensive Online Solutions

Klaus Tachtler

unread,
Sep 28, 2012, 8:51:30 PM9/28/12
to
Hello,

> Hello,
>
> I am on CentOS 6.3, using: amavisd-new-2.8.0-1.el6.x86_64 (which I
> built using the RPMForge SRPM for amavis 2.6.6 and current amavis
> source release).
>
> Installed/used:
> ---------------
> spamassassin-3.3.1-2.el6.x86_64
> clamav-db-0.97.6-1.el6.rf.x86_64
> clamd-0.97.6-1.el6.rf.x86_64
> clamav-0.97.6-1.el6.rf.x86_64
>

so, I have a similar setup with CentOS 6.3 - documented for myself on
a non-profit DukoWiki. Maybe, you can compare things I did with things
you did, to find out somthing that you can help.

Here is the Link:
http://www.dokuwiki.tachtler.net/doku.php?id=tachtler:postfix_spamassassin_installieren

Another one, install description for my AMaViS:
http://www.dokuwiki.tachtler.net/doku.php?id=tachtler:postfix_amavis_installieren


Good night...
Klaus.


--

------------------------------------------
e-Mail : kl...@tachtler.net
Homepage: http://www.tachtler.net
DokuWiki: http://www.dokuwiki.tachtler.net
------------------------------------------

Mike

unread,
Sep 29, 2012, 1:05:57 PM9/29/12
to
On 09/28/2012 08:02 AM, John Hinton wrote:
> On 9/28/2012 8:41 AM, Nikolaos Milas wrote:
>> On 28/9/2012 12:08 μμ, Nikolaos Milas wrote:
>>
>>> # tail -f /var/log/sa-update.log
>>> ./sa-update: line 12: 10: command not found
>>
>> It seems that this output is left from an older run (and I don't know
>> how it came up).
>>
>> In all recent runs, it seems there is no output at all.
>>
>> When I run simply "/usr/bin/sa-update -D", everything seems to run
>> smoothly.
>>
>> So, I would guess something is wrong in
>> /usr/share/spamassassin/sa-update.cron which does not allow proper
>> updates.
>>
>> Nick
> I had an issue where the server contacted was not responding last
> week. I was getting failed cronjob emails. It went away somewhere in
> the last several days. Sorry to not have specific times, dates and
> server name. Maybe you are seeing the residual from this?
>
I just had this yesterday:

http: GEThttp://daryl.dostech.ca/sa-update/asf/1391368.tar.gz request failed: 404 Not Found: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /sa-update/asf/1391368.tar.gz was not found on this server.</p> <hr> <address>Apache/2.2.6 (Fedora) Server at daryl.dostech.ca Port 80</address> </body></html>

But I think this is a different issue.

Could you just set up your own cron job to run sa-update? I'm not sure
of the typical configuration on CentOS but on FreeBSD I set up a script
to run weekly (your path information will differ; test with the debug
first).:


#!/bin/sh

PATH=/usr/local/libexec/ccache:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin

# Debug:
#/usr/local/bin/sa-update -D
/usr/local/bin/sa-update

Tilman Mayer

unread,
Oct 1, 2012, 2:48:59 AM10/1/12
to
We do have this issue, too.
I just removed the mirror from the file /var/lib/spamassassin/3.003002/updates_spamassassin_org/MIRRORED.BY and everything runs fine again.

There is an issue for this:
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6838

Regards
Tilman


-----Ursprüngliche Nachricht-----
Von: Mike [mailto:new...@mjws.net]
Gesendet: Samstag, 29. September 2012 19:06
An: amavis...@amavis.org
Betreff: Re: spam assassin rules update

Nikolaos Milas

unread,
Oct 16, 2012, 3:33:47 AM10/16/12
to
On 28/9/2012 3:41 μμ, Nikolaos Milas wrote:

> When I run simply "/usr/bin/sa-update -D", everything seems to run
> smoothly.

As an update, I am now using the following line in /etc/cron.d/sa-update:

10 3 * * * root /usr/bin/sa-update -D | tee -a /var/log/sa-update.log &&
/etc/init.d/amavisd condrestart

Unfortunately nothing gets logged in sa-update.log (so I guess "| tee -a
/var/log/sa-update.log" could be left-out) but at least I get an
automatic email (by the cron system) with all the output of the above
commands, so I know what's happening.

Nick

Tom Hendrikx

unread,
Oct 16, 2012, 4:02:17 AM10/16/12
to
sa-update talks to stderr, so for the above to work, you'll need
something like:

/usr/bin/sa-update -D 2>&1 | tee -a /var/log/sa-update.log

--
Tom

0 new messages