[Mimedefang] RE: HELP! At end of my rope with MD/SA

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Thu Jul 7 03:20:36 EDT 2005

On Wed, 6 Jul 2005, Dirk the Daring wrote:


> Summary: Adding SA v3.0.4 to an existing MD v2.52 install breaks MD

> I wrote:
>>> If I add
>>> 	$Features{'SpamAssassin'} = 1;
>>> to mimedefang-filter, so I can eliminate the "if $Features" logic and
>>> simplify my -filter file, I get the following error:
>>> Can't locate object method "new" via package "Mail::SpamAssassin"
>>> (perhaps you forgot to load "Mail::SpamAssassin"?) at
>>> /opt/mimedefang/bin/mimedefang.pl line 6177.
>>> Compilation failed in require at /opt/mimedefang/bin/mimedefang.pl
>>> line 4881.
> The last command won't run unless I remove the "Features{'SpamAssassin'}" from
> mimedefang-filter. If I leave that in, I get the same error as in my
> first message.

Hmm, I've re-checked with the archive, there you said that you really mean 
that you've >>eliminate(d) the "if $Features" logic<<

Well, I agree with:

The basic question is: WHY do you want to remove the "if logic" at all?

quote: "If I run MD with a filter that *optionally* adds SA (that is, using
         if ($Features{"SpamAssassin"})
constructions as the default filter does, MD works fine.
    If I add
         $Features{'SpamAssassin'} = 1;
First: $Features{'SpamAssassin'} should be '1' already, if SpamAssassin 
is present and useable.
(Also: It does not 'optionally add SA' in your filter, but pre-load the 
SA-framework. The "add" is performed in mimedefang.pl - search for "use 
Mail::SpamAssassin ()")

What I haven't understood from your posts:
Is spamAssassin used at runtime (scan time) at all, when the "if logic" is 
present, or not?
Or is mimedefang.pl -features is telling, that SA is present, but it is 
NOT present while scanning mails?

Also, in 
you indicate that your MIMEDefang _and_ perl are located in /opt, whereas 
you indicate that both reside under /usr/bin.

The error indicates that "use Mail::SpamAssassin ();" had not been seen by 
perl. The question is why, actually.

I'd do the following to investigate:

a) recompile mimedefang

b) keep the if logic, unless there is some real reason to remove it (it 
won't take that much resources in your environment, will it?)

c) insert a "print "\$Features{'SpamAssassin'} = " . 
$Features{'SpamAssassin'} . "\n"; prior the "if logic" and watch the 
output of "./mimedefang.pl -features".
(Note: I really mean ./mimedefang.pl and NOT perl mimedefang.pl)
(Oh: and verify that 'pwd' displays the very same path as used in 
/etc/init.d/mimedefang) (Note#2: Remove the line, before using the 

if nothing obvious is to be seen:
d) $(head -1 mimedefang.pl | sed -e '1,$s/#!//') -d mimedefang.pl 
in order to verify, why the "use Mail::SpamAssassin ();" is not seen by 
perl. (Note: I really mean $(head -1 mimedefang.pl | sed -e '1,$s/#!//') )

on doubt:
e) add  "use Mail::SpamAssassin ();" right next to where you've placed: 
$Features{'SpamAssassin'} = 1;
and watch the difference(s).


Steffen Kaiser

More information about the MIMEDefang mailing list