You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by "Philip A. Prindeville" <ph...@redfish-solutions.com> on 2010/01/30 21:16:01 UTC

Magical mystery colon

I ran "yum update" on my FC11 machine a couple of days ago, and now I'm
getting nightly cron errors:

plugin: failed to parse plugin (from @INC): syntax error at (eval 84) line 1, near "require Mail::SpamAssassin:"

plugin: failed to parse plugin (from @INC): syntax error at (eval 148) line 1, near "require Mail::SpamAssassin:"

I've seen this message periodically, but never figured out what generated it.

Can someone set me straight?  It of course doesn't mention a file, so it's hard to know where it's coming from.

Also, how come the eval block:


        foreach $thing (qw(Anomy::HTMLCleaner Archive::Zip Digest::SHA1 HTML::Parser HTML::TokeParser IO::Socket IO::Stringy MIME::Base64 MIME::Tools MIME::Words Mail::Mailer Mail::SpamAssassin Net::DNS Unix::Syslog )) {
            unless (eval "require $thing") {
                printf("%-30s: missing\n", $thing);
                next;
            }

doesn't contain a terminating ';', i.e.:

eval "require $thing;" instead?

Thanks,

-Philip



Re: Magical mystery colon

Posted by Aaron Wolfe <aa...@gmail.com>.
wow, based on the subject alone, I thought my SA had missed a very strange
spam :)


On Sat, Jan 30, 2010 at 3:16 PM, Philip A. Prindeville <
philipp_subx@redfish-solutions.com> wrote:

> I ran "yum update" on my FC11 machine a couple of days ago, and now I'm
> getting nightly cron errors:
>
> plugin: failed to parse plugin (from @INC): syntax error at (eval 84) line
> 1, near "require Mail::SpamAssassin:"
>
> plugin: failed to parse plugin (from @INC): syntax error at (eval 148) line
> 1, near "require Mail::SpamAssassin:"
>
> I've seen this message periodically, but never figured out what generated
> it.
>
> Can someone set me straight?  It of course doesn't mention a file, so it's
> hard to know where it's coming from.
>
> Also, how come the eval block:
>
>
>        foreach $thing (qw(Anomy::HTMLCleaner Archive::Zip Digest::SHA1
> HTML::Parser HTML::TokeParser IO::Socket IO::Stringy MIME::Base64
> MIME::Tools MIME::Words Mail::Mailer Mail::SpamAssassin Net::DNS
> Unix::Syslog )) {
>            unless (eval "require $thing") {
>                printf("%-30s: missing\n", $thing);
>                next;
>            }
>
> doesn't contain a terminating ';', i.e.:
>
> eval "require $thing;" instead?
>
> Thanks,
>
> -Philip
>
>
>

Re: Magical mystery colon

Posted by "Philip A. Prindeville" <ph...@redfish-solutions.com>.
On 02/01/2010 05:35 AM, Mark Martinec wrote:
> On Saturday January 30 2010 21:16:01 Philip A. Prindeville wrote:
>   
>> Also, how come the eval block:
>>   unless (eval "require $thing") {...}
>> doesn't contain a terminating ';', i.e.:
>> eval "require $thing;" instead?
>>     
> It is not needed. It is an 'eval EXPR', not 'eval BLOCK'.
> A semicolon in perl is a statement separator, not a statement terminator.
>
>   Mark
>   

Ok.  No one knows why I'm seeing the warnings from the cron job, however?



Re: Magical mystery colon

Posted by Mark Martinec <Ma...@ijs.si>.
On Saturday January 30 2010 21:16:01 Philip A. Prindeville wrote:
> Also, how come the eval block:
>   unless (eval "require $thing") {...}
> doesn't contain a terminating ';', i.e.:
> eval "require $thing;" instead?

It is not needed. It is an 'eval EXPR', not 'eval BLOCK'.
A semicolon in perl is a statement separator, not a statement terminator.

  Mark

Re: Magical mystery colon

Posted by "Philip A. Prindeville" <ph...@redfish-solutions.com>.
On 01/30/2010 12:24 PM, Karsten Bräckelmann wrote:
> On Sat, 2010-01-30 at 12:16 -0800, Philip A. Prindeville wrote:
>   
>> I ran "yum update" on my FC11 machine a couple of days ago, and now I'm
>> getting nightly cron errors:
>>     
> Would be nice and maybe even helpful to know, what command(s) that cron
> job executes, don't you think? :)
>   

Well, this is unmodified Fedora, so the same as every other Fedora box:

10 4 * * * root /usr/share/spamassassin/sa-update.cron 2>&1 | tee -a /var/log/sa-update.log


And that script contains:


#!/bin/bash
# *** DO NOT MODIFY THIS FILE ***
#
# /etc/mail/spamassassin/channel.d/*.conf
#     Place files here to add custom channels.
#

# 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

# 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



>   
>> plugin: failed to parse plugin (from @INC): syntax error at (eval 84) line 1, near "require Mail::SpamAssassin:"
>>
>> plugin: failed to parse plugin (from @INC): syntax error at (eval 148) line 1, near "require Mail::SpamAssassin:"
>>
>> I've seen this message periodically, but never figured out what
>> generated it.
>>
>> Can someone set me straight?  It of course doesn't mention a file, so
>> it's hard to know where it's coming from.
>>     
>   



Re: Magical mystery colon

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Sat, 2010-01-30 at 12:16 -0800, Philip A. Prindeville wrote:
> I ran "yum update" on my FC11 machine a couple of days ago, and now I'm
> getting nightly cron errors:

Would be nice and maybe even helpful to know, what command(s) that cron
job executes, don't you think? :)

> plugin: failed to parse plugin (from @INC): syntax error at (eval 84) line 1, near "require Mail::SpamAssassin:"
> 
> plugin: failed to parse plugin (from @INC): syntax error at (eval 148) line 1, near "require Mail::SpamAssassin:"
> 
> I've seen this message periodically, but never figured out what
> generated it.
> 
> Can someone set me straight?  It of course doesn't mention a file, so
> it's hard to know where it's coming from.

-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}