Mauro,
> > You should be calling
$spamassassin_obj->signal_user_changed
> > each time from within sub call_spamassassin.
> This is where my problem lies: I was unable to find
said
> sub call_spamassassin yet (BTW, we are running
amavisd-new-2.4.2
> (20060627)).
I was referring to 2.5.0. If you are contemplating code
changes,
you should not waste your time with a year-old version,
time will leave you behind.
That being said, that part of the code is similar,
just moved into a new subroutine to be able to run
SA as a detached process in case somebody wished to do so.
> My best guess for what you could have meant with
> "call_spamassassin" is:
>
> sub check {
> ...
> };
>
> But, as I have to admit, things in there are too
complicated for me to
> understand. Here is my try though: This is the point
where I assume
> SA is called:
> do_log(5,"calling SA parse, SA version %s",
$sa_version);
> if ($sa_version=~/^(d+(?:.d+)?)/ && $1
>= 3) {
> $mail_obj = $spamassassin_obj->parse( lines);
> } else { # 2.63 or earlier
> It seems to me, just inserting something like
> $spamassassin_obj->signal_user_changed(
> {
> username => $msginfo->recips,
> user_dir => undef
> }
> );
> into that if-clause would not work, right?
Like I said, the $msginfo->recips is a _list_ or
recipients,
not a single recipient.
Something like the following might work for single-recipient
messages
(patch against 2.5.0), although I haven't tried it (apart
from
syntactical correctness):
--- amavisd.orig Mon Apr 23 05:25:30 2007
+++ amavisd Mon May 21 20:38:02 2007
 -17565,4
+17565,10 
eval {
$which_section = 'SA parse';
+ my($recips) = $msginfo->recips;
+ if ( $recips == 1) {
+ do_log(3,"changing SA user to %s",
$recips->[0]);
+ # $spamassassin_obj->load_scoreonly_...
+ $spamassassin_obj->signal_user_changed({username
=> $recips->[0]});
+ }
do_log(5,"calling SA parse, SA version %s,
%.6f",
$sa_version, $sa_version_num);
Mark
------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-user lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/
|