Hi folks
I am running amavisd-new-2.3.2. I know its a bit old but I can't
easily update it at this stage - I'm stuck with it. :)
In the logs I get lines like this:
May 7 22:44:17 ms1 amavis[28944]: (28944-04) X-Spam-Score:16.985 ---
X-Spam-
Tests:tests
=
[BAYES_99
=
3.5
,FORGED_RCVD_HELO
=
0.135
,HTML_50_60
=
0.134
,HTML_MESSAGE
=
0.001
,RAZOR2_CHECK
=
0.5
,RCVD_IN_BL_SPAMCOP_NET
=5,SARE_ENLRGYOUR=1.331,SPF_SOFTFAIL=1.384,URIBL_BLACK=3,URIBL_SBL=2]
The key bit that interests me is the tests output. I would like to
store that in my sql table in the message record. Please note that
while I have 20+ years programming I've not touched perl so in this
respect I am "hacking".
The code fragments I found were:
In the sql clauses
'upd_msg' =>
'UPDATE tblmails SET dsnsent=?, spamscore=?,spamstatus=?,'.
' messageid=?,
subject
=
?,badHeader
=?,contents=?,virusstatus=?,blackwhitestatus=?,attachmentstatus=?
WHERE pkmailid=?',
In the sub save_info_final {
my $attach_status = $msginfo->attachment ? 't' :
'f';
$conn_h->execute($sql_cl_r->{'upd_msg'},
untaint($dsn_sent),
untaint($spam_level),untaint($spam_status_int),
untaint($m_id), untaint($subj),
untaint
($
badHeader
),untaint
($
body),untaint($virusstatus),untaint($bwstatus),untaint($attach_status),
$mail_id);
and in the sub add_forwarding_header_edits_per_recip
do_log(-1,"X-Spam-Score:" . $spam_level . " ---
X-Spam-Tests:" . $spam_status);
So.......
Using the example showing that $spam_status had the info I wanted, I
changed the above code as follows:
'upd_msg' =>
'UPDATE tblmails SET dsnsent=?, spamscore=?,spamstatus=?,'.
' messageid=?,
subject
=
?,badHeader
=
?,contents
=?,virusstatus=?,blackwhitestatus=?,attachmentstatus=?,spamreason=?
WHERE pkmailid=?',
and
my $attach_status = $msginfo->attachment ? 't' :
'f';
$conn_h->execute($sql_cl_r->{'upd_msg'},
untaint($dsn_sent),
untaint($spam_level),untaint($spam_status_int),
untaint($m_id), untaint($subj),
untaint
($
badHeader
),untaint
($
body
),untaint
($
virusstatus
),untaint($bwstatus),untaint($attach_status),untaint($spam_status),
$mail_id);
When I run the program I get an error:
Problem in Amavis::SQL::Log code: Global symbol "$spam_status"
requires explicit package name at (eval 40) line 255
I suspect this is because of use_strict and $spam_status not being
defined in some way, but I thought it was a global variable.
Could anyone please help with this ?
much appreciated
Grant
Grant Maxwell
maXan Pty Ltd
Ph: 61 2 90293452
Mob: 61 41 9227165
[EMAIL PROTECTED]
The information in this e-mail is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this e-
mail by anyone else is unauthorised. If you have received this
communication in error, please notify us immediately by return e-mail
with the subject heading "Received in error" or telephone +61 2
90293452, then delete the email and destroy any copies of it. If you
are not the intended recipient, any disclosure, copying, distribution
or any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Opinions, conclusions and other
information in this e-mail and any attachments that do not relate to
the business of the maXan are neither given nor endorsed by it.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/